mirror of
https://git.code.sf.net/p/ngspice/ngspice
synced 2026-08-22 05:47:42 +02:00
restrict removal of arg only to comma operator,
otherwise functions with a single variable may fail
This commit is contained in:
@@ -307,7 +307,10 @@ struct pnode *PP_mkfnode(const char *func, struct pnode *arg)
|
|||||||
/* Give the user-defined functions a try. */
|
/* Give the user-defined functions a try. */
|
||||||
q = ft_substdef(func, arg);
|
q = ft_substdef(func, arg);
|
||||||
if (q) { /* found */
|
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;
|
return q;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user