| 162 | |
| 163 | |
| 164 | int luaD_rawrunprotected(lua_State *L, Pfunc f, void *ud) { |
| 165 | unsigned short oldnCcalls = L->nCcalls; |
| 166 | struct lua_longjmp lj; |
| 167 | lj.status = LUA_OK; |
| 168 | lj.previous = L->errorJmp; /* chain new error handler */ |
| 169 | L->errorJmp = &lj; |
| 170 | LUAI_TRY(L, &lj, |
| 171 | (*f)(L, ud); |
| 172 | ); |
| 173 | L->errorJmp = lj.previous; /* restore old error handler */ |
| 174 | L->nCcalls = oldnCcalls; |
| 175 | // TODO: 如果有错误,考虑在这里加进来,通知lua_State有错误 |
| 176 | return lj.status; |
| 177 | } |
| 178 | |
| 179 | /* }====================================================== */ |
| 180 |
no outgoing calls
no test coverage detected