summaryrefslogtreecommitdiff
path: root/compiler.c
diff options
context:
space:
mode:
Diffstat (limited to 'compiler.c')
-rw-r--r--compiler.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/compiler.c b/compiler.c
index cd11b0d..6bcb201 100644
--- a/compiler.c
+++ b/compiler.c
@@ -5022,9 +5022,12 @@ Variable _eval(Scope *s, CompData *data, Vector *tokens, size_t start, size_t en
return rhs;
}
- if (op != 10 && !scope_is_tmp(&out)) {
+ if (op != 10 && (!scope_is_tmp(&out) || _var_ptr_type(&out) == PTYPE_REF)) {
Variable tmp = scope_mk_tmp(s, data, &out);
- var_end(&out);
+ if (scope_is_tmp(&out))
+ scope_free_tmp(s, data, &out);
+ else
+ var_end(&out);
out = tmp;
}