MCPcopy Create free account
hub / github.com/defold/defold / luaD_pcall

Function luaD_pcall

engine/lua/src/lua/ldo.c:455–477  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

453
454
455int luaD_pcall (lua_State *L, Pfunc func, void *u,
456 ptrdiff_t old_top, ptrdiff_t ef) {
457 int status;
458 unsigned short oldnCcalls = L->nCcalls;
459 ptrdiff_t old_ci = saveci(L, L->ci);
460 lu_byte old_allowhooks = L->allowhook;
461 ptrdiff_t old_errfunc = L->errfunc;
462 L->errfunc = ef;
463 status = luaD_rawrunprotected(L, func, u);
464 if (status != 0) { /* an error occurred? */
465 StkId oldtop = restorestack(L, old_top);
466 luaF_close(L, oldtop); /* close eventual pending closures */
467 luaD_seterrorobj(L, status, oldtop);
468 L->nCcalls = oldnCcalls;
469 L->ci = restoreci(L, old_ci);
470 L->base = L->ci->base;
471 L->savedpc = L->ci->savedpc;
472 L->allowhook = old_allowhooks;
473 restore_stack_limit(L);
474 }
475 L->errfunc = old_errfunc;
476 return status;
477}
478
479
480

Callers 3

luaD_protectedparserFunction · 0.85
lua_pcallFunction · 0.85
lua_cpcallFunction · 0.85

Calls 4

luaD_rawrunprotectedFunction · 0.85
luaF_closeFunction · 0.85
luaD_seterrorobjFunction · 0.85
restore_stack_limitFunction · 0.85

Tested by

no test coverage detected