summaryrefslogtreecommitdiff
path: root/src/lparser.js
diff options
context:
space:
mode:
authordaurnimator <quae@daurnimator.com>2017-05-22 23:26:44 +1000
committerdaurnimator <quae@daurnimator.com>2017-05-23 00:52:05 +1000
commit13328c5bee9b847317313491c3eb9f6f66766de7 (patch)
tree296f23842670f89b07227e0546ed40a42d9ea2f6 /src/lparser.js
parente6639768e4a059aeaf80e232c729dffa3b5e93ba (diff)
downloadfengari-13328c5bee9b847317313491c3eb9f6f66766de7.tar.gz
fengari-13328c5bee9b847317313491c3eb9f6f66766de7.tar.bz2
fengari-13328c5bee9b847317313491c3eb9f6f66766de7.zip
Add luaD_inctop calls where appropriate
Diffstat (limited to 'src/lparser.js')
-rw-r--r--src/lparser.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/lparser.js b/src/lparser.js
index 100342a..13f75c9 100644
--- a/src/lparser.js
+++ b/src/lparser.js
@@ -4,6 +4,7 @@ const assert = require('assert');
const defs = require('./defs.js');
const lcode = require('./lcode.js');
+const ldo = require('./ldo.js');
const lfunc = require('./lfunc.js');
const llex = require('./llex.js');
const llimit = require('./llimit.js');
@@ -1563,9 +1564,11 @@ const luaY_parser = function(L, z, buff, dyd, name, firstchar) {
let lexstate = new llex.LexState();
let funcstate = new FuncState();
let cl = lfunc.luaF_newLclosure(L, 1); /* create main closure */
- L.stack[L.top++] = new TValue(defs.CT.LUA_TLCL, cl);
+ ldo.luaD_inctop(L);
+ L.stack[L.top-1] = new TValue(defs.CT.LUA_TLCL, cl);
lexstate.h = ltable.luaH_new(L); /* create table for scanner */
- L.stack[L.top++] = new TValue(defs.CT.LUA_TTABLE, lexstate.h);
+ ldo.luaD_inctop(L);
+ L.stack[L.top-1] = new TValue(defs.CT.LUA_TTABLE, lexstate.h);
funcstate.f = cl.p = new Proto(L);
funcstate.f.source = lstring.luaS_new(L, name);
lexstate.buff = buff;