diff options
Diffstat (limited to 'ldebug.c')
-rw-r--r-- | ldebug.c | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -264,8 +264,7 @@ static void funcinfo (lua_Debug *ar, Closure *cl) { | |||
264 | else { | 264 | else { |
265 | const Proto *p = cl->l.p; | 265 | const Proto *p = cl->l.p; |
266 | if (p->source) { | 266 | if (p->source) { |
267 | ar->source = getstr(p->source); | 267 | ar->source = getlstr(p->source, ar->srclen); |
268 | ar->srclen = tsslen(p->source); | ||
269 | } | 268 | } |
270 | else { | 269 | else { |
271 | ar->source = "=?"; | 270 | ar->source = "=?"; |
@@ -797,8 +796,11 @@ l_noret luaG_ordererror (lua_State *L, const TValue *p1, const TValue *p2) { | |||
797 | const char *luaG_addinfo (lua_State *L, const char *msg, TString *src, | 796 | const char *luaG_addinfo (lua_State *L, const char *msg, TString *src, |
798 | int line) { | 797 | int line) { |
799 | char buff[LUA_IDSIZE]; | 798 | char buff[LUA_IDSIZE]; |
800 | if (src) | 799 | if (src) { |
801 | luaO_chunkid(buff, getstr(src), tsslen(src)); | 800 | size_t idlen; |
801 | const char *id = getlstr(src, idlen); | ||
802 | luaO_chunkid(buff, id, idlen); | ||
803 | } | ||
802 | else { /* no source available; use "?" instead */ | 804 | else { /* no source available; use "?" instead */ |
803 | buff[0] = '?'; buff[1] = '\0'; | 805 | buff[0] = '?'; buff[1] = '\0'; |
804 | } | 806 | } |