Skip to content

Commit

Permalink
Debugger: Lua - Fixed rare crash when loading script due to uninitial…
Browse files Browse the repository at this point in the history
…ized memory when Lua io/os access is enabled
  • Loading branch information
SourMesen committed Dec 23, 2023
1 parent f2b0afa commit d0f8980
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Lua/lstate.c
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,10 @@ static void preinit_thread (lua_State *L, global_State *g) {
L->status = LUA_OK;
L->errfunc = 0;
L->oldpc = 0;
// ##### MESEN MODIFICATION #####
L->watchdoghook = NULL;
L->watchdogtimer = 0;
// ##### MESEN MODIFICATION #####
}


Expand Down Expand Up @@ -303,10 +307,6 @@ LUA_API lua_State *lua_newthread (lua_State *L) {
L1->hookmask = L->hookmask;
L1->basehookcount = L->basehookcount;
L1->hook = L->hook;
// ##### MESEN MODIFICATION #####
L1->watchdoghook = NULL;
L1->watchdogtimer = 0;
// ##### MESEN MODIFICATION #####
resethookcount(L1);
/* initialize L1 extra space */
memcpy(lua_getextraspace(L1), lua_getextraspace(g->mainthread),
Expand Down

0 comments on commit d0f8980

Please sign in to comment.