Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/facebook/luaffifb.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/ffi.c
diff options
context:
space:
mode:
authorJames R. McKaskill <james@foobar.co.nz>2012-06-04 05:27:18 +0400
committerJames R. McKaskill <james@foobar.co.nz>2012-06-04 05:28:28 +0400
commit3d258f087d26105eaee8bb6fd95bf0a23b1162f5 (patch)
treebbbe81fcdeaa460c7afe5a7c17b22f14f355b57e /ffi.c
parent0bc6f30a0c9c78cfa8fa42e96d437dfbccdcfaeb (diff)
ffi_number should call tonumber with all args and rets
Fixes #40
Diffstat (limited to 'ffi.c')
-rw-r--r--ffi.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/ffi.c b/ffi.c
index 11b9ae5..3526af0 100644
--- a/ffi.c
+++ b/ffi.c
@@ -2301,9 +2301,9 @@ static int ffi_number(lua_State* L)
/* call the old _G.tonumber, we use an upvalue as _G.tonumber is set
* to this function */
lua_pushvalue(L, lua_upvalueindex(1));
- lua_pushvalue(L, 1);
- lua_call(L, 1, LUA_MULTRET);
- return 1;
+ lua_insert(L, 1);
+ lua_call(L, lua_gettop(L)-1, LUA_MULTRET);
+ return lua_gettop(L);
}
}