| 1160 | } |
| 1161 | |
| 1162 | static void printStack(lua_State* L) |
| 1163 | { |
| 1164 | int top = lua_gettop(L); |
| 1165 | int bottom = 1; |
| 1166 | lua_getglobal(L, "tostring"); |
| 1167 | for(int i = top; i >= bottom; i--) |
| 1168 | { |
| 1169 | lua_pushvalue(L, -1); |
| 1170 | lua_pushvalue(L, i); |
| 1171 | lua_pcall(L, 1, 1, 0); |
| 1172 | const char *str = lua_tostring(L, -1); |
| 1173 | if (str) { |
| 1174 | printf("%2d: %s\n", i, str); |
| 1175 | }else{ |
| 1176 | printf("%2d: %s\n", i, luaL_typename(L, i)); |
| 1177 | } |
| 1178 | lua_pop(L, 1); |
| 1179 | } |
| 1180 | lua_pop(L, 1); |
| 1181 | } |
| 1182 | |
| 1183 | static bool g_panic_function_called = false; |
| 1184 |
nothing calls this directly
no test coverage detected