summaryrefslogtreecommitdiff
path: root/frontends
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2014-08-21 17:33:40 +0200
committerClifford Wolf <clifford@clifford.at>2014-08-21 17:33:40 +0200
commitad146c25823505e8f9b3cb2b67ba00821a755375 (patch)
tree09cad3d11d697b3172d6b6a877cfb7bc75879956 /frontends
parent6c5cafcd8bf4d6b12b4d510480a0ccc1adee7212 (diff)
Fixed small memory leak in ast simplify
Diffstat (limited to 'frontends')
-rw-r--r--frontends/ast/simplify.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/frontends/ast/simplify.cc b/frontends/ast/simplify.cc
index 859058cb..68c17271 100644
--- a/frontends/ast/simplify.cc
+++ b/frontends/ast/simplify.cc
@@ -1585,8 +1585,8 @@ skip_dynamic_range_lvalue_expansion:;
{
AstNode *arg = children[arg_count++]->clone();
AstNode *assign = child->is_input ?
- new AstNode(AST_ASSIGN_EQ, wire_id, arg) :
- new AstNode(AST_ASSIGN_EQ, arg, wire_id);
+ new AstNode(AST_ASSIGN_EQ, wire_id->clone(), arg) :
+ new AstNode(AST_ASSIGN_EQ, arg, wire_id->clone());
for (auto it = current_block->children.begin(); it != current_block->children.end(); it++) {
if (*it != current_block_child)
@@ -1596,7 +1596,7 @@ skip_dynamic_range_lvalue_expansion:;
}
}
- AstNode *cell_arg = new AstNode(AST_ARGUMENT, wire_id->clone());
+ AstNode *cell_arg = new AstNode(AST_ARGUMENT, wire_id);
cell_arg->str = child->str == str ? outport : child->str;
cell->children.push_back(cell_arg);
}