diff options
Diffstat (limited to 'functions.c')
-rw-r--r-- | functions.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/functions.c b/functions.c index 46cbe7a..7e462c3 100644 --- a/functions.c +++ b/functions.c @@ -141,7 +141,7 @@ runfunc(Function f, Array *left, Array *right) code = f.operator.dop; } - pushdfnframe(code, lefto, righto, left, right); + pushdfnframe(code, f.scope, lefto, righto, left, right); Datum *dfnres = evalline(code, nil, 0); popdfnframe(); @@ -228,6 +228,7 @@ rundfn(Rune *code, Datum *lefto, Datum *righto, Array *left, Array *right) Function dfn; dfn.type = FunctypeDfn; dfn.dfn = code; + dfn.scope = getcurrentdfn(); return runfunc(dfn, left, right); }else if(lefto != nil){ Function dop; @@ -237,6 +238,7 @@ rundfn(Rune *code, Datum *lefto, Datum *righto, Array *left, Array *right) dop.operator.right = righto; dop.operator.dyadic = righto != nil; dop.operator.dop = code; + dop.scope = getcurrentdfn(); return runfunc(dop, left, right); }else{ throwerror(L"Malformed call to rundfn", ENotImplemented); |