From adb643fc8130cd396acf08153f75e2f1cd059bd7 Mon Sep 17 00:00:00 2001 From: glenda Date: Mon, 19 Sep 2022 08:29:59 +0000 Subject: Don't refcount symbol tables --- functions.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'functions.c') diff --git a/functions.c b/functions.c index 0dd898d..102590d 100644 --- a/functions.c +++ b/functions.c @@ -135,6 +135,7 @@ runfunc(Function f, Array *left, Array *right) Rune *code; Datum *lefto = nil; Datum *righto = nil; + if(f.type == FunctypeDfn) code = f.dfn; else{ @@ -143,9 +144,10 @@ runfunc(Function f, Array *left, Array *right) code = f.operator.dop; } - pushdfnframe(code, f.scope, lefto, righto, left, right); + DfnFrame *fr = pushdfnframe(code, f.scope, lefto, righto, left, right); Datum *dfnres = evalline(code, nil, 0); - popdfnframe(); + if(fr == getcurrentdfn()) + popdfnframe(); result = dfnres->array; /* TODO what if the evaluation failed */ if(dfnres->tag != ArrayTag || result == nil) -- cgit v1.2.3