diff options
author | daurnimator <quae@daurnimator.com> | 2017-05-22 23:26:44 +1000 |
---|---|---|
committer | daurnimator <quae@daurnimator.com> | 2017-05-23 00:52:05 +1000 |
commit | 13328c5bee9b847317313491c3eb9f6f66766de7 (patch) | |
tree | 296f23842670f89b07227e0546ed40a42d9ea2f6 /src/lobject.js | |
parent | e6639768e4a059aeaf80e232c729dffa3b5e93ba (diff) | |
download | fengari-13328c5bee9b847317313491c3eb9f6f66766de7.tar.gz fengari-13328c5bee9b847317313491c3eb9f6f66766de7.tar.bz2 fengari-13328c5bee9b847317313491c3eb9f6f66766de7.zip |
Add luaD_inctop calls where appropriate
Diffstat (limited to 'src/lobject.js')
-rw-r--r-- | src/lobject.js | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/lobject.js b/src/lobject.js index e7b716e..fad3b73 100644 --- a/src/lobject.js +++ b/src/lobject.js @@ -461,7 +461,8 @@ const luaO_tostring = function(L, obj) { }; const pushstr = function(L, str) { - L.stack[L.top++] = new TValue(CT.LUA_TLNGSTR, lstring.luaS_new(L, str)); + ldo.luaD_inctop(L); + L.stack[L.top-1] = new TValue(CT.LUA_TLNGSTR, lstring.luaS_new(L, str)); }; const luaO_pushvfstring = function(L, fmt, argp) { @@ -488,10 +489,12 @@ const luaO_pushvfstring = function(L, fmt, argp) { break; case char['d']: case char['I']: - L.stack[L.top++] = luaO_tostring(L, new TValue(CT.LUA_TNUMINT, argp[a++])); + ldo.luaD_inctop(L); + L.stack[L.top-1] = luaO_tostring(L, new TValue(CT.LUA_TNUMINT, argp[a++])); break; case char['f']: - L.stack[L.top++] = luaO_tostring(L, new TValue(CT.LUA_TNUMFLT, argp[a++])); + ldo.luaD_inctop(L); + L.stack[L.top-1] = luaO_tostring(L, new TValue(CT.LUA_TNUMFLT, argp[a++])); break; // case char['p']: case char['U']: |