diff options
Diffstat (limited to '')
-rw-r--r-- | src/lib_jit.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lib_jit.c b/src/lib_jit.c index 8fda41d0..a5829dc3 100644 --- a/src/lib_jit.c +++ b/src/lib_jit.c | |||
@@ -177,7 +177,7 @@ LJLIB_CF(jit_util_funcinfo) | |||
177 | GCtab *t; | 177 | GCtab *t; |
178 | lua_createtable(L, 0, 16); /* Increment hash size if fields are added. */ | 178 | lua_createtable(L, 0, 16); /* Increment hash size if fields are added. */ |
179 | t = tabV(L->top-1); | 179 | t = tabV(L->top-1); |
180 | setintfield(L, t, "linedefined", pt->linedefined); | 180 | setintfield(L, t, "linedefined", proto_line(pt, 0)); |
181 | setintfield(L, t, "lastlinedefined", pt->lastlinedefined); | 181 | setintfield(L, t, "lastlinedefined", pt->lastlinedefined); |
182 | setintfield(L, t, "stackslots", pt->framesize); | 182 | setintfield(L, t, "stackslots", pt->framesize); |
183 | setintfield(L, t, "params", pt->numparams); | 183 | setintfield(L, t, "params", pt->numparams); |
@@ -185,9 +185,9 @@ LJLIB_CF(jit_util_funcinfo) | |||
185 | setintfield(L, t, "gcconsts", (int32_t)pt->sizekgc); | 185 | setintfield(L, t, "gcconsts", (int32_t)pt->sizekgc); |
186 | setintfield(L, t, "nconsts", (int32_t)pt->sizekn); | 186 | setintfield(L, t, "nconsts", (int32_t)pt->sizekn); |
187 | setintfield(L, t, "upvalues", (int32_t)pt->sizeuv); | 187 | setintfield(L, t, "upvalues", (int32_t)pt->sizeuv); |
188 | if (pc-1 < pt->sizebc) | 188 | if (pc < pt->sizebc) |
189 | setintfield(L, t, "currentline", | 189 | setintfield(L, t, "currentline", |
190 | proto_lineinfo(pt) ? proto_line(pt, pc-1) : 0); | 190 | proto_lineinfo(pt) ? proto_line(pt, pc) : 0); |
191 | lua_pushboolean(L, (pt->flags & PROTO_IS_VARARG)); | 191 | lua_pushboolean(L, (pt->flags & PROTO_IS_VARARG)); |
192 | lua_setfield(L, -2, "isvararg"); | 192 | lua_setfield(L, -2, "isvararg"); |
193 | setstrV(L, L->top++, proto_chunkname(pt)); | 193 | setstrV(L, L->top++, proto_chunkname(pt)); |
@@ -209,7 +209,7 @@ LJLIB_CF(jit_util_funcinfo) | |||
209 | LJLIB_CF(jit_util_funcbc) | 209 | LJLIB_CF(jit_util_funcbc) |
210 | { | 210 | { |
211 | GCproto *pt = check_Lproto(L, 0); | 211 | GCproto *pt = check_Lproto(L, 0); |
212 | BCPos pc = (BCPos)lj_lib_checkint(L, 2) - 1; | 212 | BCPos pc = (BCPos)lj_lib_checkint(L, 2); |
213 | if (pc < pt->sizebc) { | 213 | if (pc < pt->sizebc) { |
214 | BCIns ins = proto_bc(pt)[pc]; | 214 | BCIns ins = proto_bc(pt)[pc]; |
215 | BCOp op = bc_op(ins); | 215 | BCOp op = bc_op(ins); |