diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2016-04-11 16:19:55 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2016-04-11 16:19:55 -0300 |
commit | fdd7209688d9d96cbfc003db4f78701321acd3bf (patch) | |
tree | d78086bd203fdad1b71f3ed21479cdc390dda0c6 /lcorolib.c | |
parent | 82a8e065247f710aea237563815d82aa5f515905 (diff) | |
download | lua-fdd7209688d9d96cbfc003db4f78701321acd3bf.tar.gz lua-fdd7209688d9d96cbfc003db4f78701321acd3bf.tar.bz2 lua-fdd7209688d9d96cbfc003db4f78701321acd3bf.zip |
error handling in 'wrap' does not coerce numbers into string messages
Diffstat (limited to 'lcorolib.c')
-rw-r--r-- | lcorolib.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lcorolib.c,v 1.8 2014/10/25 11:50:46 roberto Exp roberto $ | 2 | ** $Id: lcorolib.c,v 1.9 2014/11/02 19:19:04 roberto Exp roberto $ |
3 | ** Coroutine Library | 3 | ** Coroutine Library |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -75,7 +75,7 @@ static int luaB_auxwrap (lua_State *L) { | |||
75 | lua_State *co = lua_tothread(L, lua_upvalueindex(1)); | 75 | lua_State *co = lua_tothread(L, lua_upvalueindex(1)); |
76 | int r = auxresume(L, co, lua_gettop(L)); | 76 | int r = auxresume(L, co, lua_gettop(L)); |
77 | if (r < 0) { | 77 | if (r < 0) { |
78 | if (lua_isstring(L, -1)) { /* error object is a string? */ | 78 | if (lua_type(L, -1) == LUA_TSTRING) { /* error object is a string? */ |
79 | luaL_where(L, 1); /* add extra info */ | 79 | luaL_where(L, 1); /* add extra info */ |
80 | lua_insert(L, -2); | 80 | lua_insert(L, -2); |
81 | lua_concat(L, 2); | 81 | lua_concat(L, 2); |