Skip to content

Commit

Permalink
Update ci->top, as done by lua_checkstack
Browse files Browse the repository at this point in the history
Hopefully this should fix the assertion failures from #511
  • Loading branch information
hugomg committed Oct 19, 2022
1 parent 0da0d5d commit 38dac19
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/pallene/coder.lua
Original file line number Diff line number Diff line change
Expand Up @@ -443,10 +443,10 @@ function Coder:pallene_entry_point_definition(f_id)
local slots_needed = max_frame_size + self.max_lua_call_stack_usage[func]
if slots_needed > 0 then
table.insert(prologue, util.render([[
luaD_checkstackaux(L,
$slots_needed,
(void)0,
$restore_stack);
luaD_checkstackaux(L, $slots_needed, (void)0, $restore_stack);
if (L->ci->top < base + $slots_needed) {
L->ci->top = base + $slots_needed;
}
]], {
slots_needed = C.integer(slots_needed),
restore_stack = self:restorestack():match("^(.-);$"),
Expand Down

0 comments on commit 38dac19

Please sign in to comment.