diff options
author | Benoit Germain <bnt period germain arrobase gmail period com> | 2014-01-24 11:08:46 +0100 |
---|---|---|
committer | Benoit Germain <bnt period germain arrobase gmail period com> | 2014-01-24 11:08:46 +0100 |
commit | d412b1ea9f9c2568ed83e85e6d893368ac12537a (patch) | |
tree | 66e465012a152daa86e70b6a52ea0acf3220ad11 /src/tools.c | |
parent | ae19ebab381e6902cce2c7a3efd4a0949357c866 (diff) | |
download | lanes-d412b1ea9f9c2568ed83e85e6d893368ac12537a.tar.gz lanes-d412b1ea9f9c2568ed83e85e6d893368ac12537a.tar.bz2 lanes-d412b1ea9f9c2568ed83e85e6d893368ac12537a.zip |
another Lua stack overflow fix
Diffstat (limited to 'src/tools.c')
-rw-r--r-- | src/tools.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/tools.c b/src/tools.c index e456db7..fc3e7e0 100644 --- a/src/tools.c +++ b/src/tools.c | |||
@@ -1559,6 +1559,7 @@ static void lookup_native_func( lua_State* L2, lua_State* L, uint_t i, enum eLoo | |||
1559 | size_t len; | 1559 | size_t len; |
1560 | ASSERT_L( lua_isfunction( L, i)); // ... f ... | 1560 | ASSERT_L( lua_isfunction( L, i)); // ... f ... |
1561 | STACK_CHECK( L); | 1561 | STACK_CHECK( L); |
1562 | STACK_GROW( L, 3); // up to 3 slots are necessary on error | ||
1562 | if( mode_ == eLM_FromKeeper) | 1563 | if( mode_ == eLM_FromKeeper) |
1563 | { | 1564 | { |
1564 | lua_CFunction f = lua_tocfunction( L, i); // should *always* be sentinelfunc! | 1565 | lua_CFunction f = lua_tocfunction( L, i); // should *always* be sentinelfunc! |
@@ -1609,7 +1610,7 @@ static void lookup_native_func( lua_State* L2, lua_State* L, uint_t i, enum eLoo | |||
1609 | STACK_END( L, 0); | 1610 | STACK_END( L, 0); |
1610 | // push the equivalent function in the destination's stack, retrieved from the lookup table | 1611 | // push the equivalent function in the destination's stack, retrieved from the lookup table |
1611 | STACK_CHECK( L2); | 1612 | STACK_CHECK( L2); |
1612 | STACK_GROW( L2, 2); | 1613 | STACK_GROW( L2, 3); // up to 3 slots are necessary on error |
1613 | if( mode_ == eLM_ToKeeper) | 1614 | if( mode_ == eLM_ToKeeper) |
1614 | { | 1615 | { |
1615 | // push a sentinel closure that holds the lookup name as upvalue | 1616 | // push a sentinel closure that holds the lookup name as upvalue |