diff --git a/frontends/systemverilog/uhdm_ast.cc b/frontends/systemverilog/uhdm_ast.cc index 521137e54..1c16c8dbc 100644 --- a/frontends/systemverilog/uhdm_ast.cc +++ b/frontends/systemverilog/uhdm_ast.cc @@ -1031,6 +1031,8 @@ static AST::AstNode *convert_dot(AST::AstNode *wire_node, AST::AstNode *node, AS // offset = size * n auto index = dot->children.at(0)->children.at(0); auto move_offset = new AST::AstNode(AST::AST_MUL, target_size, index->clone()); + delete expanded->children[0]; + delete expanded->children[1]; expanded->children[0] = new AST::AstNode(AST::AST_ADD, move_offset, target_l->clone()); expanded->children[1] = new AST::AstNode(AST::AST_ADD, move_offset->clone(), target_r->clone()); return expanded;