Skip to content

Commit

Permalink
[VM/baselib] fix loadfile/loadstring error reporting
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicolas BOUQUET committed Feb 12, 2024
1 parent c8f298f commit 1e96126
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions VM/src/lbaselib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ static int luaB_loadfile(lua_State *L) {
int nret=luaL_loadfilenamed(L, s, luaL_optstring(L,2,s));
if (nret>0) {
lua_pushnil(L);
lua_replace(L,-2);
lua_replace(L,-3);
return 2;
}
if (nret==-1) {
Expand All @@ -451,7 +451,7 @@ static int luaB_loadstring(lua_State *L) {
int nret=luaL_loadbuffer(L, s, sz, luaL_optstring(L,2,"string-chunk"));
if (nret>0) {
lua_pushnil(L);
lua_replace(L,-2);
lua_replace(L,-3);
return 2;
}
if (nret==-1) {
Expand Down

0 comments on commit 1e96126

Please sign in to comment.