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