mirror of
https://github.com/LuaJIT/LuaJIT.git
synced 2025-02-07 23:24:09 +00:00
Fix frame traversal for backtraces.
This commit is contained in:
parent
a6936be814
commit
fffe75a03b
@ -71,9 +71,18 @@ static BCPos debug_framepc(lua_State *L, GCfunc *fn, cTValue *nextframe)
|
|||||||
/* Lua function below errfunc/gc/hook: find cframe to get the PC. */
|
/* Lua function below errfunc/gc/hook: find cframe to get the PC. */
|
||||||
void *cf = cframe_raw(L->cframe);
|
void *cf = cframe_raw(L->cframe);
|
||||||
TValue *f = L->base-1;
|
TValue *f = L->base-1;
|
||||||
if (cf == NULL)
|
for (;;) {
|
||||||
return NO_BCPOS;
|
if (cf == NULL)
|
||||||
while (f > nextframe) {
|
return NO_BCPOS;
|
||||||
|
while (cframe_nres(cf) < 0) {
|
||||||
|
if (f >= restorestack(L, -cframe_nres(cf)))
|
||||||
|
break;
|
||||||
|
cf = cframe_raw(cframe_prev(cf));
|
||||||
|
if (cf == NULL)
|
||||||
|
return NO_BCPOS;
|
||||||
|
}
|
||||||
|
if (f < nextframe)
|
||||||
|
break;
|
||||||
if (frame_islua(f)) {
|
if (frame_islua(f)) {
|
||||||
f = frame_prevl(f);
|
f = frame_prevl(f);
|
||||||
} else {
|
} else {
|
||||||
@ -82,8 +91,6 @@ static BCPos debug_framepc(lua_State *L, GCfunc *fn, cTValue *nextframe)
|
|||||||
f = frame_prevd(f);
|
f = frame_prevd(f);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (cframe_prev(cf))
|
|
||||||
cf = cframe_raw(cframe_prev(cf));
|
|
||||||
ins = cframe_pc(cf);
|
ins = cframe_pc(cf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user