diff options
Diffstat (limited to 'src/lj_api.c')
-rw-r--r-- | src/lj_api.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lj_api.c b/src/lj_api.c index d1be3abf..711c7e9d 100644 --- a/src/lj_api.c +++ b/src/lj_api.c | |||
@@ -1032,7 +1032,7 @@ static TValue *api_call_base(lua_State *L, int nargs) | |||
1032 | 1032 | ||
1033 | LUA_API void lua_call(lua_State *L, int nargs, int nresults) | 1033 | LUA_API void lua_call(lua_State *L, int nargs, int nresults) |
1034 | { | 1034 | { |
1035 | api_check(L, L->status == 0 || L->status == LUA_ERRERR); | 1035 | api_check(L, L->status == LUA_OK || L->status == LUA_ERRERR); |
1036 | api_checknelems(L, nargs+1); | 1036 | api_checknelems(L, nargs+1); |
1037 | lj_vm_call(L, api_call_base(L, nargs), nresults+1); | 1037 | lj_vm_call(L, api_call_base(L, nargs), nresults+1); |
1038 | } | 1038 | } |
@@ -1043,7 +1043,7 @@ LUA_API int lua_pcall(lua_State *L, int nargs, int nresults, int errfunc) | |||
1043 | uint8_t oldh = hook_save(g); | 1043 | uint8_t oldh = hook_save(g); |
1044 | ptrdiff_t ef; | 1044 | ptrdiff_t ef; |
1045 | int status; | 1045 | int status; |
1046 | api_check(L, L->status == 0 || L->status == LUA_ERRERR); | 1046 | api_check(L, L->status == LUA_OK || L->status == LUA_ERRERR); |
1047 | api_checknelems(L, nargs+1); | 1047 | api_checknelems(L, nargs+1); |
1048 | if (errfunc == 0) { | 1048 | if (errfunc == 0) { |
1049 | ef = 0; | 1049 | ef = 0; |
@@ -1075,7 +1075,7 @@ LUA_API int lua_cpcall(lua_State *L, lua_CFunction func, void *ud) | |||
1075 | global_State *g = G(L); | 1075 | global_State *g = G(L); |
1076 | uint8_t oldh = hook_save(g); | 1076 | uint8_t oldh = hook_save(g); |
1077 | int status; | 1077 | int status; |
1078 | api_check(L, L->status == 0 || L->status == LUA_ERRERR); | 1078 | api_check(L, L->status == LUA_OK || L->status == LUA_ERRERR); |
1079 | status = lj_vm_cpcall(L, func, ud, cpcall); | 1079 | status = lj_vm_cpcall(L, func, ud, cpcall); |
1080 | if (status) hook_restore(g, oldh); | 1080 | if (status) hook_restore(g, oldh); |
1081 | return status; | 1081 | return status; |
@@ -1140,7 +1140,7 @@ LUA_API int lua_resume(lua_State *L, int nargs) | |||
1140 | { | 1140 | { |
1141 | if (L->cframe == NULL && L->status <= LUA_YIELD) | 1141 | if (L->cframe == NULL && L->status <= LUA_YIELD) |
1142 | return lj_vm_resume(L, | 1142 | return lj_vm_resume(L, |
1143 | L->status == 0 ? api_call_base(L, nargs) : L->top - nargs, | 1143 | L->status == LUA_OK ? api_call_base(L, nargs) : L->top - nargs, |
1144 | 0, 0); | 1144 | 0, 0); |
1145 | L->top = L->base; | 1145 | L->top = L->base; |
1146 | setstrV(L, L->top, lj_err_str(L, LJ_ERR_COSUSP)); | 1146 | setstrV(L, L->top, lj_err_str(L, LJ_ERR_COSUSP)); |