gsl-shell.git - gsl-shell

index : gsl-shell.git
gsl-shell
summary refs log tree commit diff
diff options
context:
space:
mode:
Diffstat
-rw-r--r--src/lj_debug.c 17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/lj_debug.c b/src/lj_debug.c
index be7fb2b1..09896462 100644
--- a/src/lj_debug.c
+++ b/src/lj_debug.c
@@ -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. */
void *cf = cframe_raw(L->cframe);
TValue *f = L->base-1;
- if (cf == NULL)
- return NO_BCPOS;
- while (f > nextframe) {
+ for (;;) {
+ if (cf == NULL)
+ 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)) {
f = frame_prevl(f);
} else {
@@ -82,8 +91,6 @@ static BCPos debug_framepc(lua_State *L, GCfunc *fn, cTValue *nextframe)
f = frame_prevd(f);
}
}
- if (cframe_prev(cf))
- cf = cframe_raw(cframe_prev(cf));
ins = cframe_pc(cf);
}
}
generated by cgit v1.2.3 (git 2.46.0) at 2025年10月06日 14:18:18 +0000

AltStyle によって変換されたページ (->オリジナル) /