1
0
mirror of synced 2025-02-20 04:01:01 +01:00

patterns: Fixed multi-variable decl crash

This commit is contained in:
WerWolv 2021-10-05 22:08:05 +02:00
parent e3a6ac548b
commit 7eb4b40dc7

View File

@ -715,8 +715,9 @@ namespace hex::pl {
auto variableCleanup = SCOPE_GUARD { for (auto var : variables) delete var; };
do {
variables.push_back(create(new ASTNodeVariableDecl(getValue<Token::Identifier>(-1).get(), type)));
variables.push_back(create(new ASTNodeVariableDecl(getValue<Token::Identifier>(-1).get(), type->clone())));
} while (MATCHES(sequence(SEPARATOR_COMMA, IDENTIFIER)));
delete type;
variableCleanup.release();