The expression needs to be cloned so transformations don't corrupt the original
expression. This could be slightly optimized by only taking a reference and
COW'ing when necessary (which is actually quite rare).
Signed-off-by: Patrick McHardy <kaber@trash.net>
return expr_error(ctx, *expr,
"undefined identifier '%s'",
(*expr)->identifier);
- // FIXME: need to copy (on write)
- new = expr_get(sym->expr);
+ new = expr_clone(sym->expr);
} else {
erec = symbol_parse(*expr, &new);
if (erec != NULL) {