lua 5.3 returns type for lua_rawget

This commit is contained in:
Cloud Wu
2015-01-20 21:59:08 +08:00
parent 6baa04b6e1
commit 9e8d4a453b

View File

@@ -775,8 +775,7 @@ lreplace(lua_State *L) {
return luaL_error(L, "call makeindex first");
}
lua_pushvalue(L,2);
lua_rawget(L, -2);
if (!lua_isnumber(L,-1)) {
if (lua_rawget(L, -2) != LUA_TNUMBER) {
return luaL_error(L, "Can't replace key : %s", lua_tostring(L,2));
}
int id = lua_tointeger(L, -1);