diff options
author | Mike Pall <mike> | 2013-09-03 16:02:54 +0200 |
---|---|---|
committer | Mike Pall <mike> | 2013-09-03 16:02:54 +0200 |
commit | f8cecffbbf0fdb7a038d48c136a4bba67c64881e (patch) | |
tree | 642ff017e1d3c5c392c1177cf7288b1c74785799 /src/lj_debug.c | |
parent | a4fa4dcfdf5649fb5df623f31648046113c70b61 (diff) | |
parent | b6ec7c7c86ac249ac40a241e1c9b47b729bbba3b (diff) | |
download | luajit-f8cecffbbf0fdb7a038d48c136a4bba67c64881e.tar.gz luajit-f8cecffbbf0fdb7a038d48c136a4bba67c64881e.tar.bz2 luajit-f8cecffbbf0fdb7a038d48c136a4bba67c64881e.zip |
Merge branch 'master' into v2.1
Diffstat (limited to 'src/lj_debug.c')
-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 8166fcc0..92c216f9 100644 --- a/src/lj_debug.c +++ b/src/lj_debug.c | |||
@@ -72,9 +72,18 @@ static BCPos debug_framepc(lua_State *L, GCfunc *fn, cTValue *nextframe) | |||
72 | /* Lua function below errfunc/gc/hook: find cframe to get the PC. */ | 72 | /* Lua function below errfunc/gc/hook: find cframe to get the PC. */ |
73 | void *cf = cframe_raw(L->cframe); | 73 | void *cf = cframe_raw(L->cframe); |
74 | TValue *f = L->base-1; | 74 | TValue *f = L->base-1; |
75 | if (cf == NULL) | 75 | for (;;) { |
76 | return NO_BCPOS; | 76 | if (cf == NULL) |
77 | while (f > nextframe) { | 77 | return NO_BCPOS; |
78 | while (cframe_nres(cf) < 0) { | ||
79 | if (f >= restorestack(L, -cframe_nres(cf))) | ||
80 | break; | ||
81 | cf = cframe_raw(cframe_prev(cf)); | ||
82 | if (cf == NULL) | ||
83 | return NO_BCPOS; | ||
84 | } | ||
85 | if (f < nextframe) | ||
86 | break; | ||
78 | if (frame_islua(f)) { | 87 | if (frame_islua(f)) { |
79 | f = frame_prevl(f); | 88 | f = frame_prevl(f); |
80 | } else { | 89 | } else { |
@@ -83,8 +92,6 @@ static BCPos debug_framepc(lua_State *L, GCfunc *fn, cTValue *nextframe) | |||
83 | f = frame_prevd(f); | 92 | f = frame_prevd(f); |
84 | } | 93 | } |
85 | } | 94 | } |
86 | if (cframe_prev(cf)) | ||
87 | cf = cframe_raw(cframe_prev(cf)); | ||
88 | ins = cframe_pc(cf); | 95 | ins = cframe_pc(cf); |
89 | } | 96 | } |
90 | } | 97 | } |