** Unrolls a coroutine in protected mode while there are recoverable ** errors, that is, errors inside a protected call. (Any error ** interrupts 'unroll', and this loop protects it again so it can ** continue.) Stops with a normal end (status == LUA_OK), an yield ** (status == LUA_YIELD), or an unprotected error ('findpcall' doesn't ** find a recover point). */
| 822 | ** find a recover point). |
| 823 | */ |
| 824 | static int precover (lua_State *L, int status) { |
| 825 | CallInfo *ci; |
| 826 | while (errorstatus(status) && (ci = findpcall(L)) != NULL) { |
| 827 | L->ci = ci; /* go down to recovery functions */ |
| 828 | setcistrecst(ci, status); /* status to finish 'pcall' */ |
| 829 | status = luaD_rawrunprotected(L, unroll, NULL); |
| 830 | } |
| 831 | return status; |
| 832 | } |
| 833 | |
| 834 | |
| 835 | LUA_API int lua_resume (lua_State *L, lua_State *from, int nargs, |
no test coverage detected