diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2008-08-13 14:02:12 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2008-08-13 14:02:12 -0300 |
| commit | c1565c16edc487f32d87d1742a7c8e76d0b10236 (patch) | |
| tree | 31ca4a4f361ca2a5fceb9ff5a2b4b570c57f2bc0 | |
| parent | 394646891cc406ce2a0f1586409c043c9caeab4e (diff) | |
| download | lua-c1565c16edc487f32d87d1742a7c8e76d0b10236.tar.gz lua-c1565c16edc487f32d87d1742a7c8e76d0b10236.tar.bz2 lua-c1565c16edc487f32d87d1742a7c8e76d0b10236.zip | |
small bug: lua_resume returning LUA_YIELD is not an error
| -rw-r--r-- | ltests.c | 4 |
1 files changed, 2 insertions, 2 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: ltests.c,v 2.52 2008/06/23 16:50:34 roberto Exp roberto $ | 2 | ** $Id: ltests.c,v 2.53 2008/06/26 19:42:45 roberto Exp roberto $ |
| 3 | ** Internal Module for Debugging of the Lua Implementation | 3 | ** Internal Module for Debugging of the Lua Implementation |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -1072,7 +1072,7 @@ static int coresume (lua_State *L) { | |||
| 1072 | lua_State *co = lua_tothread(L, 1); | 1072 | lua_State *co = lua_tothread(L, 1); |
| 1073 | luaL_argcheck(L, co, 1, "coroutine expected"); | 1073 | luaL_argcheck(L, co, 1, "coroutine expected"); |
| 1074 | status = lua_resume(co, 0); | 1074 | status = lua_resume(co, 0); |
| 1075 | if (status != 0) { | 1075 | if (status != LUA_OK && status != LUA_YIELD) { |
| 1076 | lua_pushboolean(L, 0); | 1076 | lua_pushboolean(L, 0); |
| 1077 | lua_insert(L, -2); | 1077 | lua_insert(L, -2); |
| 1078 | return 2; /* return false + error message */ | 1078 | return 2; /* return false + error message */ |
