summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Marques <george@gmarqu.es>2021-05-17 18:50:25 -0300
committerGitHub <noreply@github.com>2021-05-17 18:50:25 -0300
commitcdb3726fe6c9d41701dc89e572c6b2631d14cf6f (patch)
treef1f7709aeb717297a6d47a130fab32007780b9a7
parent92c04fa727e3fc507e31c1bce88beeceb98fb06a (diff)
parent82522662f85680863c043b56733831f4a5df2a2e (diff)
Merge pull request #48347 from Blackiris/fix-temporary-key-not-released
GDScript: Fix temporary value not released when used as a dictionary key
-rw-r--r--modules/gdscript/gdscript_compiler.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/modules/gdscript/gdscript_compiler.cpp b/modules/gdscript/gdscript_compiler.cpp
index f495b0d787..4ac9864d4f 100644
--- a/modules/gdscript/gdscript_compiler.cpp
+++ b/modules/gdscript/gdscript_compiler.cpp
@@ -971,6 +971,9 @@ GDScriptCodeGenerator::Address GDScriptCompiler::_parse_expression(CodeGen &code
} else {
gen->write_set(prev_base, key, assigned);
}
+ if (key.mode == GDScriptCodeGenerator::Address::TEMPORARY) {
+ gen->pop_temporary();
+ }
if (assigned.mode == GDScriptCodeGenerator::Address::TEMPORARY) {
gen->pop_temporary();
}