diff options
Diffstat (limited to 'src/lj_err.c')
-rw-r--r-- | src/lj_err.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/lj_err.c b/src/lj_err.c index 0c54cf62..cf7f9ae4 100644 --- a/src/lj_err.c +++ b/src/lj_err.c | |||
@@ -129,7 +129,7 @@ static BCLine currentline(lua_State *L, GCfunc *fn, cTValue *nextframe) | |||
129 | if (pc != ~(BCPos)0) { | 129 | if (pc != ~(BCPos)0) { |
130 | GCproto *pt = funcproto(fn); | 130 | GCproto *pt = funcproto(fn); |
131 | lua_assert(pc < pt->sizebc); | 131 | lua_assert(pc < pt->sizebc); |
132 | return pt->lineinfo ? pt->lineinfo[pc] : 0; | 132 | return proto_lineinfo(pt) ? proto_line(pt, pc) : 0; |
133 | } else { | 133 | } else { |
134 | return -1; | 134 | return -1; |
135 | } | 135 | } |
@@ -224,7 +224,7 @@ void lj_err_pushloc(lua_State *L, GCproto *pt, BCPos pc) | |||
224 | MSize i, len = name->len; | 224 | MSize i, len = name->len; |
225 | BCLine line; | 225 | BCLine line; |
226 | if (pc) | 226 | if (pc) |
227 | line = pt->lineinfo ? pt->lineinfo[pc-1] : 0; | 227 | line = proto_lineinfo(pt) ? proto_line(pt, pc-1) : 0; |
228 | else | 228 | else |
229 | line = pt->linedefined; | 229 | line = pt->linedefined; |
230 | if (*s == '@') { | 230 | if (*s == '@') { |
@@ -377,10 +377,12 @@ LUA_API int lua_getinfo(lua_State *L, const char *what, lua_Debug *ar) | |||
377 | case 'L': | 377 | case 'L': |
378 | if (isluafunc(fn)) { | 378 | if (isluafunc(fn)) { |
379 | GCtab *t = lj_tab_new(L, 0, 0); | 379 | GCtab *t = lj_tab_new(L, 0, 0); |
380 | BCLine *lineinfo = funcproto(fn)->lineinfo; | 380 | BCLine *lineinfo = proto_lineinfo(funcproto(fn)); |
381 | uint32_t i, szl = funcproto(fn)->sizelineinfo; | 381 | if (lineinfo) { |
382 | for (i = 0; i < szl; i++) | 382 | uint32_t i, szl = funcproto(fn)->sizelineinfo; |
383 | setboolV(lj_tab_setint(L, t, lineinfo[i]), 1); | 383 | for (i = 0; i < szl; i++) |
384 | setboolV(lj_tab_setint(L, t, lineinfo[i]), 1); | ||
385 | } | ||
384 | settabV(L, L->top, t); | 386 | settabV(L, L->top, t); |
385 | } else { | 387 | } else { |
386 | setnilV(L->top); | 388 | setnilV(L->top); |