Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions modules/gdscript/gdscript_vm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4005,6 +4005,11 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a
for (int i = FIXED_ADDRESSES_MAX; i < _stack_size; i++) {
stack[i].~Variant();
}
if (p_state) {
// Mark the state's stack as cleared to prevent double-free
// in ~GDScriptFunctionState::_clear_stack().
p_state->stack_size = 0;
}
}

// Always free reserved addresses, since they are never copied.
Expand Down
Loading