diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2024-01-25 13:52:52 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2024-01-25 13:52:52 -0300 |
commit | 108e0bdc8495782544c351b17eaae1411a910e89 (patch) | |
tree | 1196b9d9288b38b0be0290e30ec818fa09d06238 /ltests.c | |
parent | b34a97a4af5c9e973915c07dba918d95009e0acd (diff) | |
parent | e288c5a91883793d14ed9e9d93464f6ee0b08915 (diff) | |
download | lua-108e0bdc8495782544c351b17eaae1411a910e89.tar.gz lua-108e0bdc8495782544c351b17eaae1411a910e89.tar.bz2 lua-108e0bdc8495782544c351b17eaae1411a910e89.zip |
Merge branch 'master' into nextversion
Diffstat (limited to 'ltests.c')
-rw-r--r-- | ltests.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -73,8 +73,9 @@ 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); | 76 | const char *msg = (lua_type(L, -1) == LUA_TSTRING) |
77 | if (msg == NULL) msg = "error object is not a string"; | 77 | ? lua_tostring(L, -1) |
78 | : "error object is not a string"; | ||
78 | return (badexit("PANIC: unprotected error in call to Lua API (%s)\n", | 79 | return (badexit("PANIC: unprotected error in call to Lua API (%s)\n", |
79 | msg, NULL), | 80 | msg, NULL), |
80 | 0); /* do not return to Lua */ | 81 | 0); /* do not return to Lua */ |