From e3720a3da0a17a718bc1f746083c8072abb7d892 Mon Sep 17 00:00:00 2001 From: Alain Dargelas Date: Sun, 26 Nov 2023 12:00:13 -0800 Subject: [PATCH] leak --- frontends/systemverilog/uhdm_ast.cc | 2 ++ 1 file changed, 2 insertions(+) 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;