** 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). */
| 760 | ** find a recover point). |
| 761 | */ |
| 762 | static int precover (lua_State *L, int status) { |
| 763 | CallInfo *ci; |
| 764 | while (errorstatus(status) && (ci = findpcall(L)) != NULL) { |
| 765 | L->ci = ci; /* go down to recovery functions */ |
| 766 | setcistrecst(ci, status); /* status to finish 'pcall' */ |
| 767 | status = luaD_rawrunprotected(L, unroll, NULL); |
| 768 | } |
| 769 | return status; |
| 770 | } |
| 771 | |
| 772 | |
| 773 | LUA_API int lua_resume (lua_State *L, lua_State *from, int nargs, |
no test coverage detected