summaryrefslogtreecommitdiff
path: root/libs/liblua/src/lcorolib.c
diff options
context:
space:
mode:
Diffstat (limited to 'libs/liblua/src/lcorolib.c')
-rw-r--r--libs/liblua/src/lcorolib.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/libs/liblua/src/lcorolib.c b/libs/liblua/src/lcorolib.c
index fedbebec39..c165031d28 100644
--- a/libs/liblua/src/lcorolib.c
+++ b/libs/liblua/src/lcorolib.c
@@ -31,14 +31,14 @@ static lua_State *getco (lua_State *L) {
*/
static int auxresume (lua_State *L, lua_State *co, int narg) {
int status, nres;
- if (l_unlikely(!lua_checkstack(co, narg))) {
+ if (!lua_checkstack(co, narg)) {
lua_pushliteral(L, "too many arguments to resume");
return -1; /* error flag */
}
lua_xmove(L, co, narg);
status = lua_resume(co, L, narg, &nres);
- if (l_likely(status == LUA_OK || status == LUA_YIELD)) {
- if (l_unlikely(!lua_checkstack(L, nres + 1))) {
+ if (status == LUA_OK || status == LUA_YIELD) {
+ if (!lua_checkstack(L, nres + 1)) {
lua_pop(co, nres); /* remove results anyway */
lua_pushliteral(L, "too many results to resume");
return -1; /* error flag */
@@ -57,7 +57,7 @@ static int luaB_coresume (lua_State *L) {
lua_State *co = getco(L);
int r;
r = auxresume(L, co, lua_gettop(L) - 1);
- if (l_unlikely(r < 0)) {
+ if (r < 0) {
lua_pushboolean(L, 0);
lua_insert(L, -2);
return 2; /* return false + error message */
@@ -73,13 +73,10 @@ static int luaB_coresume (lua_State *L) {
static int luaB_auxwrap (lua_State *L) {
lua_State *co = lua_tothread(L, lua_upvalueindex(1));
int r = auxresume(L, co, lua_gettop(L));
- if (l_unlikely(r < 0)) { /* error? */
+ if (r < 0) { /* error? */
int stat = lua_status(co);
- if (stat != LUA_OK && stat != LUA_YIELD) { /* error in the coroutine? */
- stat = lua_resetthread(co); /* close its tbc variables */
- lua_assert(stat != LUA_OK);
- lua_xmove(co, L, 1); /* copy error message */
- }
+ if (stat != LUA_OK && stat != LUA_YIELD) /* error in the coroutine? */
+ lua_resetthread(co); /* close its tbc variables */
if (stat != LUA_ERRMEM && /* not a memory error and ... */
lua_type(L, -1) == LUA_TSTRING) { /* ... error object is a string? */
luaL_where(L, 1); /* add extra info, if available */