From 82522662f85680863c043b56733831f4a5df2a2e Mon Sep 17 00:00:00 2001 From: Julien Nguyen Date: Sat, 1 May 2021 11:44:39 +0200 Subject: Fix temporary value not released when used as a dictionary key --- modules/gdscript/gdscript_compiler.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/gdscript/gdscript_compiler.cpp b/modules/gdscript/gdscript_compiler.cpp index 37ce8ae2cb..ead99fa425 100644 --- a/modules/gdscript/gdscript_compiler.cpp +++ b/modules/gdscript/gdscript_compiler.cpp @@ -966,6 +966,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(); } -- cgit v1.2.3