aboutsummaryrefslogtreecommitdiff
path: root/src/lj_err.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lj_err.c')
-rw-r--r--src/lj_err.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/lj_err.c b/src/lj_err.c
index d1e705ea..0c54cf62 100644
--- a/src/lj_err.c
+++ b/src/lj_err.c
@@ -176,7 +176,8 @@ restart:
176 } 176 }
177 return "field"; 177 return "field";
178 case BC_UGET: 178 case BC_UGET:
179 *name = pt->uvname ? strdata(pt->uvname[bc_d(ins)]) : "?"; 179 *name = mref(pt->uvname, GCRef) ?
180 strdata(gco2str(proto_uvname(pt,bc_d(ins)))) : "?";
180 return "upvalue"; 181 return "upvalue";
181 default: 182 default:
182 return NULL; 183 return NULL;
@@ -217,7 +218,7 @@ static const char *getfuncname(lua_State *L, TValue *frame, const char **name)
217 218
218void lj_err_pushloc(lua_State *L, GCproto *pt, BCPos pc) 219void lj_err_pushloc(lua_State *L, GCproto *pt, BCPos pc)
219{ 220{
220 GCstr *name = pt->chunkname; 221 GCstr *name = proto_chunkname(pt);
221 if (name) { 222 if (name) {
222 const char *s = strdata(name); 223 const char *s = strdata(name);
223 MSize i, len = name->len; 224 MSize i, len = name->len;
@@ -344,7 +345,7 @@ LUA_API int lua_getinfo(lua_State *L, const char *what, lua_Debug *ar)
344 switch (*what) { 345 switch (*what) {
345 case 'S': 346 case 'S':
346 if (isluafunc(fn)) { 347 if (isluafunc(fn)) {
347 ar->source = strdata(funcproto(fn)->chunkname); 348 ar->source = strdata(proto_chunkname(funcproto(fn)));
348 ar->linedefined = cast_int(funcproto(fn)->linedefined); 349 ar->linedefined = cast_int(funcproto(fn)->linedefined);
349 ar->lastlinedefined = cast_int(funcproto(fn)->lastlinedefined); 350 ar->lastlinedefined = cast_int(funcproto(fn)->lastlinedefined);
350 ar->what = (ar->linedefined == 0) ? "main" : "Lua"; 351 ar->what = (ar->linedefined == 0) ? "main" : "Lua";
@@ -819,7 +820,7 @@ LJ_NOINLINE static void err_loc(lua_State *L, const char *msg,
819 if (isluafunc(fn)) { 820 if (isluafunc(fn)) {
820 char buff[LUA_IDSIZE]; 821 char buff[LUA_IDSIZE];
821 BCLine line = currentline(L, fn, nextframe); 822 BCLine line = currentline(L, fn, nextframe);
822 err_chunkid(buff, strdata(funcproto(fn)->chunkname)); 823 err_chunkid(buff, strdata(proto_chunkname(funcproto(fn))));
823 lj_str_pushf(L, "%s:%d: %s", buff, line, msg); 824 lj_str_pushf(L, "%s:%d: %s", buff, line, msg);
824 return; 825 return;
825 } 826 }