| 634 | |
| 635 | |
| 636 | int luaD_pcall (lua_State *L, Pfunc func, void *u, |
| 637 | ptrdiff_t old_top, ptrdiff_t ef) { |
| 638 | int status; |
| 639 | CallInfo *old_ci = L->ci; |
| 640 | lu_byte old_allowhooks = L->allowhook; |
| 641 | unsigned short old_nny = L->nny; |
| 642 | ptrdiff_t old_errfunc = L->errfunc; |
| 643 | L->errfunc = ef; |
| 644 | status = luaD_rawrunprotected(L, func, u); |
| 645 | if (status != LUA_OK) { /* an error occurred? */ |
| 646 | StkId oldtop = restorestack(L, old_top); |
| 647 | luaF_close(L, oldtop); /* close possible pending closures */ |
| 648 | seterrorobj(L, status, oldtop); |
| 649 | L->ci = old_ci; |
| 650 | L->allowhook = old_allowhooks; |
| 651 | L->nny = old_nny; |
| 652 | luaD_shrinkstack(L); |
| 653 | } |
| 654 | L->errfunc = old_errfunc; |
| 655 | return status; |
| 656 | } |
| 657 | |
| 658 | |
| 659 |
no test coverage detected