Fixed memory leak.

Signed-off-by: Maciej Kurc <mkurc@antmicro.com>
This commit is contained in:
Maciej Kurc 2019-06-05 10:42:43 +02:00
parent b79bd5b3ca
commit 03e0d3a17c
1 changed files with 4 additions and 0 deletions

View File

@ -1535,11 +1535,13 @@ cell_port:
attr {
AstNode *node = new AstNode(AST_ARGUMENT);
astbuf2->children.push_back(node);
free_attr($1);
} |
attr expr {
AstNode *node = new AstNode(AST_ARGUMENT);
astbuf2->children.push_back(node);
node->children.push_back($2);
free_attr($1);
} |
attr '.' TOK_ID '(' expr ')' {
AstNode *node = new AstNode(AST_ARGUMENT);
@ -1547,12 +1549,14 @@ cell_port:
astbuf2->children.push_back(node);
node->children.push_back($5);
delete $3;
free_attr($1);
} |
attr '.' TOK_ID '(' ')' {
AstNode *node = new AstNode(AST_ARGUMENT);
node->str = *$3;
astbuf2->children.push_back(node);
delete $3;
free_attr($1);
};
always_stmt: