Merge pull request #48347 from Blackiris/fix-temporary-key-not-released

GDScript: Fix temporary value not released when used as a dictionary key
This commit is contained in:
George Marques 2021-05-17 18:50:25 -03:00 committed by GitHub
commit cdb3726fe6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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();
}