MCPcopy Create free account
hub / github.com/BZFlag-Dev/bzflag / luaG_errormsg

Function luaG_errormsg

other_src/lua/src/ldebug.cpp:617–640  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

615
616
617void luaG_errormsg (lua_State *L) {
618 StkId errfunc = NULL;
619 if (L->errfunc != 0) {
620 errfunc = restorestack(L, L->errfunc);
621 } else if (L->errfuncref) { /*BZ*/
622 TValue* rv = registry(L);
623 if (ttistable(rv)) {
624 Table* rt = hvalue(rv);
625 TValue regIndex;
626 setnvalue(&regIndex, L->errfuncref);
627 errfunc = (StkId) luaH_get(rt, &regIndex);
628 }
629 }
630 if (errfunc != NULL) {
631 if (!ttisfunction(errfunc)) {
632 luaD_throw(L, LUA_ERRERR);
633 }
634 setobjs2s(L, L->top, L->top - 1); /* move argument */
635 setobjs2s(L, L->top - 1, errfunc); /* push function */
636 incr_top(L);
637 luaD_call(L, L->top - 2, 1); /* call it */
638 }
639 luaD_throw(L, LUA_ERRRUN);
640}
641
642
643void luaG_runerror (lua_State *L, const char *fmt, ...) {

Callers 2

luaG_runerrorFunction · 0.70
lua_errorFunction · 0.70

Calls 3

luaH_getFunction · 0.70
luaD_throwFunction · 0.70
luaD_callFunction · 0.70

Tested by

no test coverage detected