the next function is called unprotected, so it must avoid errors */
| 147 | |
| 148 | /* the next function is called unprotected, so it must avoid errors */ |
| 149 | static void finalreport (lua_State *L, int status) { |
| 150 | if (status != LUA_OK) { |
| 151 | const char *msg = (lua_type(L, -1) == LUA_TSTRING) ? lua_tostring(L, -1) |
| 152 | : NULL; |
| 153 | if (msg == NULL) msg = "(error object is not a string)"; |
| 154 | l_message(progname, msg); |
| 155 | lua_pop(L, 1); |
| 156 | } |
| 157 | } |
| 158 | |
| 159 | |
| 160 | static int traceback (lua_State *L) { |