From f800298d01a0fbcf0177f4ee5c2c0cc354a429a5 Mon Sep 17 00:00:00 2001 From: Nick Gasson Date: Fri, 27 Jun 2008 12:29:50 +0100 Subject: [PATCH] Fix memory leak --- tgt-vhdl/scope.cc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tgt-vhdl/scope.cc b/tgt-vhdl/scope.cc index 85dc3ccd3..2fbcae7a0 100644 --- a/tgt-vhdl/scope.cc +++ b/tgt-vhdl/scope.cc @@ -410,17 +410,16 @@ int draw_function(ivl_scope_t scope, ivl_scope_t parent) case IVL_SIP_OUTPUT: // The magic variable Verilog_Result holds the return value signame = "Verilog_Result"; - func->set_type(sigtype); + func->set_type(new vhdl_type(*sigtype)); default: func->get_scope()->add_decl - (new vhdl_var_decl(signame.c_str(), new vhdl_type(*sigtype))); + (new vhdl_var_decl(signame.c_str(), sigtype)); } remember_signal(sig, func->get_scope()); rename_signal(sig, signame); } - - + // Non-blocking assignment not allowed in functions func->get_scope()->set_allow_signal_assignment(false);