| 196 | DISABLE_WARNING_UNREACHABLE_CODE |
| 197 | |
| 198 | ATTRNORETURN void |
| 199 | nhl_error(lua_State *L, const char *msg) |
| 200 | { |
| 201 | lua_Debug ar; |
| 202 | char buf[BUFSZ * 2]; |
| 203 | |
| 204 | lua_getstack(L, 1, &ar); |
| 205 | lua_getinfo(L, "lS", &ar); |
| 206 | Sprintf(buf, "%s (line %d ", msg, ar.currentline); |
| 207 | Sprintf(eos(buf), "%.*s)", |
| 208 | /* (max length of ar.short_src is actually LUA_IDSIZE |
| 209 | so this is overkill for it, but crucial for ar.source) */ |
| 210 | (int) (sizeof buf - (strlen(buf) + sizeof ")")), |
| 211 | ar.short_src); /* (used to be 'ar.source' here) */ |
| 212 | lua_pushstring(L, buf); |
| 213 | #if 0 /* defined(PANICTRACE) && !defined(NO_SIGNALS) */ |
| 214 | panictrace_setsignals(FALSE); |
| 215 | #endif |
| 216 | (void) lua_error(L); |
| 217 | /*NOTREACHED*/ |
| 218 | } |
| 219 | |
| 220 | RESTORE_WARNING_UNREACHABLE_CODE |
| 221 |
no test coverage detected