MCPcopy Index your code
hub / github.com/NetHack/NetHack / nhl_error

Function nhl_error

src/nhlua.c:198–218  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

196DISABLE_WARNING_UNREACHABLE_CODE
197
198ATTRNORETURN void
199nhl_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
220RESTORE_WARNING_UNREACHABLE_CODE
221

Callers 15

l_obj_checkFunction · 0.85
l_obj_getcontentsFunction · 0.85
l_obj_objects_to_tableFunction · 0.85
l_obj_new_readobjnamFunction · 0.85
l_obj_atFunction · 0.85
l_obj_placeobjFunction · 0.85
l_obj_timer_hasFunction · 0.85
l_obj_timer_peekFunction · 0.85
l_obj_timer_stopFunction · 0.85
l_obj_timer_startFunction · 0.85
l_obj_buryFunction · 0.85
get_table_mapchrFunction · 0.85

Calls 2

eosFunction · 0.85
panictrace_setsignalsFunction · 0.85

Tested by

no test coverage detected