| 719 | |
| 720 | |
| 721 | int luaD_pcall (lua_State *L, Pfunc func, void *u, |
| 722 | ptrdiff_t old_top, ptrdiff_t ef) { |
| 723 | int status; |
| 724 | CallInfo *old_ci = L->ci; |
| 725 | lu_byte old_allowhooks = L->allowhook; |
| 726 | unsigned short old_nny = L->nny; |
| 727 | ptrdiff_t old_errfunc = L->errfunc; |
| 728 | L->errfunc = ef; |
| 729 | status = luaD_rawrunprotected(L, func, u); |
| 730 | if (status != LUA_OK) { /* an error occurred? */ |
| 731 | StkId oldtop = restorestack(L, old_top); |
| 732 | luaF_close(L, oldtop); /* close possible pending closures */ |
| 733 | seterrorobj(L, status, oldtop); |
| 734 | L->ci = old_ci; |
| 735 | L->allowhook = old_allowhooks; |
| 736 | L->nny = old_nny; |
| 737 | luaD_shrinkstack(L); |
| 738 | } |
| 739 | L->errfunc = old_errfunc; |
| 740 | return status; |
| 741 | } |
| 742 | |
| 743 | |
| 744 |
no test coverage detected