You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-09 12:50:35 +00:00
Merge pull request #42067 from ThakeeNathees/for-loop-stack-overriden-fix
GDScript: for loop override stack variable bug fix
This commit is contained in:
@@ -580,8 +580,8 @@ void GDScriptByteCodeGenerator::write_endif() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void GDScriptByteCodeGenerator::write_for(const Address &p_variable, const Address &p_list) {
|
void GDScriptByteCodeGenerator::write_for(const Address &p_variable, const Address &p_list) {
|
||||||
int counter_pos = increase_stack() | (GDScriptFunction::ADDR_TYPE_STACK << GDScriptFunction::ADDR_BITS);
|
int counter_pos = add_temporary() | (GDScriptFunction::ADDR_TYPE_STACK << GDScriptFunction::ADDR_BITS);
|
||||||
int container_pos = increase_stack() | (GDScriptFunction::ADDR_TYPE_STACK << GDScriptFunction::ADDR_BITS);
|
int container_pos = add_temporary() | (GDScriptFunction::ADDR_TYPE_STACK << GDScriptFunction::ADDR_BITS);
|
||||||
|
|
||||||
current_breaks_to_patch.push_back(List<int>());
|
current_breaks_to_patch.push_back(List<int>());
|
||||||
|
|
||||||
@@ -629,7 +629,9 @@ void GDScriptByteCodeGenerator::write_endfor() {
|
|||||||
}
|
}
|
||||||
current_breaks_to_patch.pop_back();
|
current_breaks_to_patch.pop_back();
|
||||||
|
|
||||||
current_stack_size -= 2; // Remove loop temporaries.
|
// Remove loop temporaries.
|
||||||
|
pop_temporary();
|
||||||
|
pop_temporary();
|
||||||
}
|
}
|
||||||
|
|
||||||
void GDScriptByteCodeGenerator::start_while_condition() {
|
void GDScriptByteCodeGenerator::start_while_condition() {
|
||||||
|
|||||||
Reference in New Issue
Block a user