diff options
Diffstat (limited to 'ltests.c')
-rw-r--r-- | ltests.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -73,8 +73,10 @@ static void badexit (const char *fmt, const char *s1, const char *s2) { | |||
73 | 73 | ||
74 | 74 | ||
75 | static int tpanic (lua_State *L) { | 75 | static int tpanic (lua_State *L) { |
76 | const char *msg = lua_tostring(L, -1); | ||
77 | if (msg == NULL) msg = "error object is not a string"; | ||
76 | return (badexit("PANIC: unprotected error in call to Lua API (%s)\n", | 78 | return (badexit("PANIC: unprotected error in call to Lua API (%s)\n", |
77 | lua_tostring(L, -1), NULL), | 79 | msg, NULL), |
78 | 0); /* do not return to Lua */ | 80 | 0); /* do not return to Lua */ |
79 | } | 81 | } |
80 | 82 | ||