diff options
Diffstat (limited to 'src/lj_debug.c')
-rw-r--r-- | src/lj_debug.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/lj_debug.c b/src/lj_debug.c index 699fca28..4038e209 100644 --- a/src/lj_debug.c +++ b/src/lj_debug.c | |||
@@ -107,6 +107,7 @@ BCLine LJ_FASTCALL lj_debug_line(GCproto *pt, BCPos pc) | |||
107 | const void *lineinfo = proto_lineinfo(pt); | 107 | const void *lineinfo = proto_lineinfo(pt); |
108 | if (pc < pt->sizebc && lineinfo) { | 108 | if (pc < pt->sizebc && lineinfo) { |
109 | BCLine first = pt->firstline; | 109 | BCLine first = pt->firstline; |
110 | if (pc == pt->sizebc-1) return first + pt->numline; | ||
110 | if (pc-- == 0) return first; | 111 | if (pc-- == 0) return first; |
111 | if (pt->numline < 256) | 112 | if (pt->numline < 256) |
112 | return first + (BCLine)((const uint8_t *)lineinfo)[pc]; | 113 | return first + (BCLine)((const uint8_t *)lineinfo)[pc]; |
@@ -124,7 +125,7 @@ static BCLine debug_frameline(lua_State *L, GCfunc *fn, cTValue *nextframe) | |||
124 | BCPos pc = debug_framepc(L, fn, nextframe); | 125 | BCPos pc = debug_framepc(L, fn, nextframe); |
125 | if (pc != NO_BCPOS) { | 126 | if (pc != NO_BCPOS) { |
126 | GCproto *pt = funcproto(fn); | 127 | GCproto *pt = funcproto(fn); |
127 | lua_assert(pc < pt->sizebc); | 128 | lua_assert(pc <= pt->sizebc); |
128 | return lj_debug_line(pt, pc); | 129 | return lj_debug_line(pt, pc); |
129 | } | 130 | } |
130 | return -1; | 131 | return -1; |