mirror of
https://github.com/LuaJIT/LuaJIT.git
synced 2025-02-07 23:24:09 +00:00
Fix debug.debug() for non-string errors.
This commit is contained in:
parent
2f3f07882f
commit
f5b0fff5a9
@ -369,7 +369,8 @@ LJLIB_CF(debug_debug)
|
|||||||
return 0;
|
return 0;
|
||||||
if (luaL_loadbuffer(L, buffer, strlen(buffer), "=(debug command)") ||
|
if (luaL_loadbuffer(L, buffer, strlen(buffer), "=(debug command)") ||
|
||||||
lua_pcall(L, 0, 0, 0)) {
|
lua_pcall(L, 0, 0, 0)) {
|
||||||
fputs(lua_tostring(L, -1), stderr);
|
const char *s = lua_tostring(L, -1);
|
||||||
|
fputs(s ? s : "(error object is not a string)", stderr);
|
||||||
fputs("\n", stderr);
|
fputs("\n", stderr);
|
||||||
}
|
}
|
||||||
lua_settop(L, 0); /* remove eventual returns */
|
lua_settop(L, 0); /* remove eventual returns */
|
||||||
|
Loading…
Reference in New Issue
Block a user