From e275bf9ff105bbb3e12fcf15e3ab755ed0cd26cf Mon Sep 17 00:00:00 2001 From: glenda Date: Sun, 18 Sep 2022 19:58:41 +0000 Subject: Chain the symbol tables, not the dfn frames --- memory.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'memory.c') diff --git a/memory.c b/memory.c index e55485a..3416ea4 100644 --- a/memory.c +++ b/memory.c @@ -167,6 +167,7 @@ void freefunction(Function f) { freearray(f.left); + freesymtab(f.scope); switch(f.type){ case FunctypeDfn: free(f.dfn); @@ -197,6 +198,7 @@ freeoperator(Operator o) { freedatum(o.left); freedatum(o.right); + freesymtab(o.scope); switch(o.type){ case OperatortypeDop: free(o.dop); @@ -226,6 +228,8 @@ dupfunction(Function f) Function g = f; if(g.left) incarrayref(g.left); + if(g.scope) + g.scope->refs++; switch(f.type){ case FunctypeDfn: @@ -259,6 +263,9 @@ Operator dupoperator(Operator o) { Operator p = o; + if(p.scope) + p.scope->refs++; + if(p.left) incdatumref(p.left); if(p.right) -- cgit v1.2.3