diff options
author | Benoit Giannangeli <giann008@gmail.com> | 2017-05-28 11:36:00 +0200 |
---|---|---|
committer | Benoit Giannangeli <giann008@gmail.com> | 2017-05-28 11:40:31 +0200 |
commit | 8173e639527cffc583c9c6ad6e7fc0d43429ab50 (patch) | |
tree | 0fc1cb51dbeb813f48fca03716088e0ecf61a989 /src/lparser.js | |
parent | baa9730a961ab2d1810a3093f63e2c66241a6b72 (diff) | |
parent | 183768f08070003691f206ac16cb2310a7b4fa90 (diff) | |
download | fengari-8173e639527cffc583c9c6ad6e7fc0d43429ab50.tar.gz fengari-8173e639527cffc583c9c6ad6e7fc0d43429ab50.tar.bz2 fengari-8173e639527cffc583c9c6ad6e7fc0d43429ab50.zip |
Merge remote-tracking branch 'daurnimator/stack-modification-work' into test-suite
Diffstat (limited to 'src/lparser.js')
-rw-r--r-- | src/lparser.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lparser.js b/src/lparser.js index 13f75c9..0079141 100644 --- a/src/lparser.js +++ b/src/lparser.js @@ -1565,10 +1565,10 @@ const luaY_parser = function(L, z, buff, dyd, name, firstchar) { let funcstate = new FuncState(); let cl = lfunc.luaF_newLclosure(L, 1); /* create main closure */ ldo.luaD_inctop(L); - L.stack[L.top-1] = new TValue(defs.CT.LUA_TLCL, cl); + 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 */ }; |