Skip to content

Commit

Permalink
fixed declared vars leak when return (close #111)
Browse files Browse the repository at this point in the history
  • Loading branch information
ncannasse committed Jan 30, 2022
1 parent e7ccd2e commit 891a085
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions hscript/Interp.hx
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,7 @@ class Interp {
for( i in 0...params.length )
me.locals.set(params[i].name,{ r : args[i] });
var r = null;
var oldDecl = declared.length;
if( inTry )
try {
r = me.exprReturn(fexpr);
Expand All @@ -454,6 +455,7 @@ class Interp {
}
else
r = me.exprReturn(fexpr);
restore(oldDecl);
me.locals = old;
me.depth = depth;
return r;
Expand Down

0 comments on commit 891a085

Please sign in to comment.