path: root/src
diff options
authorPatrick McHardy <>2009-03-20 16:17:51 +0100
committerPatrick McHardy <>2009-03-20 16:17:51 +0100
commit0e217b46129e6f39fe38354c6682d839f4c8ae34 (patch)
tree6bf9a5ca55744b109648a78d730946b365dad303 /src
parent1bd3b87687328e1e097ca69cf18f2f14abfa9782 (diff)
Fix multiple references to the same user defined symbolic expression
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 <>
Diffstat (limited to 'src')
1 files changed, 1 insertions, 2 deletions
diff --git a/src/evaluate.c b/src/evaluate.c
index 706ec2e5..cf3ff7f7 100644
--- a/src/evaluate.c
+++ b/src/evaluate.c
@@ -113,8 +113,7 @@ static int expr_evaluate_symbol(struct eval_ctx *ctx, struct expr **expr)
return expr_error(ctx, *expr,
"undefined identifier '%s'",
- // 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) {