summaryrefslogtreecommitdiff
path: root/src/lparser.js
diff options
context:
space:
mode:
authordaurnimator <quae@daurnimator.com>2017-05-24 20:44:34 +1000
committerdaurnimator <quae@daurnimator.com>2017-05-27 22:43:18 +1000
commited0518f417a61b32e531f85c434b8024859202cd (patch)
tree39df7684f14774877a6c454d125e23b28cb5dd18 /src/lparser.js
parent1428582c2d88b23f12c87921381796d03b388d9f (diff)
downloadfengari-ed0518f417a61b32e531f85c434b8024859202cd.tar.gz
fengari-ed0518f417a61b32e531f85c434b8024859202cd.tar.bz2
fengari-ed0518f417a61b32e531f85c434b8024859202cd.zip
Modify stack values up to L.top instead of replacing
Diffstat (limited to 'src/lparser.js')
-rw-r--r--src/lparser.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lparser.js b/src/lparser.js
index 96bad67..0079141 100644
--- a/src/lparser.js
+++ b/src/lparser.js
@@ -1568,7 +1568,7 @@ const luaY_parser = function(L, z, buff, dyd, name, firstchar) {
L.stack[L.top-1].setclLvalue(cl);
lexstate.h = ltable.luaH_new(L); /* create table for scanner */
ldo.luaD_inctop(L);
- L.stack[L.top-1] = new TValue(defs.CT.LUA_TTABLE, lexstate.h);
+ L.stack[L.top-1].sethvalue(lexstate.h);
funcstate.f = cl.p = new Proto(L);
funcstate.f.source = lstring.luaS_new(L, name);
lexstate.buff = buff;
@@ -1579,7 +1579,7 @@ const luaY_parser = function(L, z, buff, dyd, name, firstchar) {
assert(!funcstate.prev && funcstate.nups === 1 && !lexstate.fs);
/* all scopes should be correctly finished */
assert(dyd.actvar.n === 0 && dyd.gt.n === 0 && dyd.label.n === 0);
- L.top--; /* remove scanner's table */
+ delete L.stack[--L.top]; /* remove scanner's table */
return cl; /* closure is on the stack, too */
};