From 9e8d4a453b00d524f290c347ec390664041d44a2 Mon Sep 17 00:00:00 2001 From: Cloud Wu Date: Tue, 20 Jan 2015 21:59:08 +0800 Subject: [PATCH] lua 5.3 returns type for lua_rawget --- lualib-src/lua-bson.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lualib-src/lua-bson.c b/lualib-src/lua-bson.c index 0a0e833f..ba97f841 100644 --- a/lualib-src/lua-bson.c +++ b/lualib-src/lua-bson.c @@ -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);