Rework stack overflow handling.

Reported by pwnhacker0x18. Fixed by Peter Cawley. #1152
This commit is contained in:
Mike Pall
2024-02-04 16:34:30 +01:00
parent 9cdd5a9479
commit defe61a567
4 changed files with 58 additions and 22 deletions

View File

@@ -63,6 +63,7 @@ static BCPos debug_framepc(lua_State *L, GCfunc *fn, cTValue *nextframe)
if (cf == NULL || (char *)cframe_pc(cf) == (char *)cframe_L(cf))
return NO_BCPOS;
ins = cframe_pc(cf); /* Only happens during error/hook handling. */
if (!ins) return NO_BCPOS;
} else {
if (frame_islua(nextframe)) {
ins = frame_pc(nextframe);