From 13328c5bee9b847317313491c3eb9f6f66766de7 Mon Sep 17 00:00:00 2001 From: daurnimator Date: Mon, 22 May 2017 23:26:44 +1000 Subject: Add luaD_inctop calls where appropriate --- src/lobject.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/lobject.js') 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']: -- cgit v1.2.3-54-g00ecf