From d3fcf2f43f60be7a8ac4589339c049b63eb216d2 Mon Sep 17 00:00:00 2001 From: Holger Vogt Date: Sun, 22 Mar 2020 11:59:28 +0100 Subject: [PATCH] restrict removal of arg only to comma operator, otherwise functions with a single variable may fail --- src/frontend/parse.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/frontend/parse.c b/src/frontend/parse.c index 2c6e9d0ff..a41d61202 100644 --- a/src/frontend/parse.c +++ b/src/frontend/parse.c @@ -307,7 +307,10 @@ struct pnode *PP_mkfnode(const char *func, struct pnode *arg) /* Give the user-defined functions a try. */ q = ft_substdef(func, arg); if (q) { /* found */ - free_pnode(arg); + /* remove only the old comma operator pnode, no longer used */ + if (arg->pn_op && arg->pn_op->op_num == PT_OP_COMMA) { + free_pnode(arg); + } return q; } }