MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / luaD_pcall

Function luaD_pcall

deps/lua/src/ldo.c:456–478  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

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