diff options
-rw-r--r-- | CHANGES | 3 | ||||
-rw-r--r-- | src/tools.c | 3 |
2 files changed, 5 insertions, 1 deletions
@@ -1,5 +1,8 @@ | |||
1 | CHANGES: | 1 | CHANGES: |
2 | 2 | ||
3 | CHANGE 96: BGe 24-Jan-14 | ||
4 | * another Lua stack overflow fix when sending complex function through lindas or as lane body | ||
5 | |||
3 | CHANGE 95: BGe 22-Jan-14 | 6 | CHANGE 95: BGe 22-Jan-14 |
4 | * version 3.8.3 | 7 | * version 3.8.3 |
5 | * fixed a possible Lua stack overflow when sending complex function through lindas or as lane body | 8 | * fixed a possible Lua stack overflow when sending complex function through lindas or as lane body |
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 |