Fix debug info for main chunk of stripped bytecode.

This commit is contained in:
Mike Pall 2014-06-11 10:19:53 +02:00
parent 7fb503dc86
commit e7c6a1afa2

View File

@ -463,7 +463,7 @@ int lj_debug_getinfo(lua_State *L, const char *what, lj_Debug *ar, int ext)
lj_debug_shortname(ar->short_src, name); lj_debug_shortname(ar->short_src, name);
ar->linedefined = (int)firstline; ar->linedefined = (int)firstline;
ar->lastlinedefined = (int)(firstline + pt->numline); ar->lastlinedefined = (int)(firstline + pt->numline);
ar->what = firstline ? "Lua" : "main"; ar->what = (firstline || !pt->numline) ? "Lua" : "main";
} else { } else {
ar->source = "=[C]"; ar->source = "=[C]";
ar->short_src[0] = '['; ar->short_src[0] = '[';