diff options
Diffstat (limited to 'src/lj_err.c')
-rw-r--r-- | src/lj_err.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/lj_err.c b/src/lj_err.c index 56ca0c37..d1e705ea 100644 --- a/src/lj_err.c +++ b/src/lj_err.c | |||
@@ -120,7 +120,7 @@ static BCPos currentpc(lua_State *L, GCfunc *fn, cTValue *nextframe) | |||
120 | ins = cframe_pc(cf); | 120 | ins = cframe_pc(cf); |
121 | } | 121 | } |
122 | } | 122 | } |
123 | return (BCPos)((ins - funcproto(fn)->bc) - 1); | 123 | return proto_bcpos(funcproto(fn), ins) - 1; |
124 | } | 124 | } |
125 | 125 | ||
126 | static BCLine currentline(lua_State *L, GCfunc *fn, cTValue *nextframe) | 126 | static BCLine currentline(lua_State *L, GCfunc *fn, cTValue *nextframe) |
@@ -149,9 +149,9 @@ static const char *getobjname(GCproto *pt, const BCIns *ip, BCReg slot, | |||
149 | { | 149 | { |
150 | const char *lname; | 150 | const char *lname; |
151 | restart: | 151 | restart: |
152 | lname = getvarname(pt, (BCPos)(ip - pt->bc), slot); | 152 | lname = getvarname(pt, proto_bcpos(pt, ip), slot); |
153 | if (lname != NULL) { *name = lname; return "local"; } | 153 | if (lname != NULL) { *name = lname; return "local"; } |
154 | while (--ip >= pt->bc) { | 154 | while (--ip >= proto_bc(pt)) { |
155 | BCIns ins = *ip; | 155 | BCIns ins = *ip; |
156 | BCOp op = bc_op(ins); | 156 | BCOp op = bc_op(ins); |
157 | BCReg ra = bc_a(ins); | 157 | BCReg ra = bc_a(ins); |
@@ -164,11 +164,11 @@ restart: | |||
164 | if (ra == slot) { slot = bc_d(ins); goto restart; } | 164 | if (ra == slot) { slot = bc_d(ins); goto restart; } |
165 | break; | 165 | break; |
166 | case BC_GGET: | 166 | case BC_GGET: |
167 | *name = strdata(gco2str(gcref(pt->k.gc[~(ptrdiff_t)bc_d(ins)]))); | 167 | *name = strdata(gco2str(proto_kgc(pt, ~(ptrdiff_t)bc_d(ins)))); |
168 | return "global"; | 168 | return "global"; |
169 | case BC_TGETS: | 169 | case BC_TGETS: |
170 | *name = strdata(gco2str(gcref(pt->k.gc[~(ptrdiff_t)bc_c(ins)]))); | 170 | *name = strdata(gco2str(proto_kgc(pt, ~(ptrdiff_t)bc_c(ins)))); |
171 | if (ip > pt->bc) { | 171 | if (ip > proto_bc(pt)) { |
172 | BCIns insp = ip[-1]; | 172 | BCIns insp = ip[-1]; |
173 | if (bc_op(insp) == BC_MOV && bc_a(insp) == ra+1 && | 173 | if (bc_op(insp) == BC_MOV && bc_a(insp) == ra+1 && |
174 | bc_d(insp) == bc_b(ins)) | 174 | bc_d(insp) == bc_b(ins)) |
@@ -201,7 +201,7 @@ static const char *getfuncname(lua_State *L, TValue *frame, const char **name) | |||
201 | if (pc == ~(BCPos)0) | 201 | if (pc == ~(BCPos)0) |
202 | return NULL; | 202 | return NULL; |
203 | lua_assert(pc < funcproto(fn)->sizebc); | 203 | lua_assert(pc < funcproto(fn)->sizebc); |
204 | ip = &funcproto(fn)->bc[pc]; | 204 | ip = &proto_bc(funcproto(fn))[pc]; |
205 | mm = bcmode_mm(bc_op(*ip)); | 205 | mm = bcmode_mm(bc_op(*ip)); |
206 | if (mm == MM_call) { | 206 | if (mm == MM_call) { |
207 | BCReg slot = bc_a(*ip); | 207 | BCReg slot = bc_a(*ip); |