| 668 | |
| 669 | |
| 670 | int luaD_pcall (lua_State *L, Pfunc func, void *u, |
| 671 | ptrdiff_t old_top, ptrdiff_t ef) { |
| 672 | int status; |
| 673 | CallInfo *old_ci = L->ci; |
| 674 | lu_byte old_allowhooks = L->allowhook; |
| 675 | unsigned short old_nny = L->nny; |
| 676 | ptrdiff_t old_errfunc = L->errfunc; |
| 677 | L->errfunc = ef; |
| 678 | status = luaD_rawrunprotected(L, func, u); |
| 679 | if (status != LUA_OK) { /* an error occurred? */ |
| 680 | StkId oldtop = restorestack(L, old_top); |
| 681 | luaF_close(L, oldtop); /* close possible pending closures */ |
| 682 | seterrorobj(L, status, oldtop); |
| 683 | L->ci = old_ci; |
| 684 | L->allowhook = old_allowhooks; |
| 685 | L->nny = old_nny; |
| 686 | luaD_shrinkstack(L); |
| 687 | } |
| 688 | L->errfunc = old_errfunc; |
| 689 | return status; |
| 690 | } |
| 691 | |
| 692 | |
| 693 |
no test coverage detected