MCPcopy Create free account
hub / github.com/bloomberg/comdb2 / luaD_pcall

Function luaD_pcall

lua/ldo.c:463–485  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

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