From 21008f2ba99245d76258c7617e05dce28311611b Mon Sep 17 00:00:00 2001 From: Pawel Szostek Date: Wed, 20 Jul 2011 14:26:34 +0200 Subject: [PATCH] Add missing or fix existing deletes in VHDL parser Thanks to valgrind analysis it turned out that there were objects in the parser that were not being deleted in a proper way. This patch fixes them all. --- vhdlpp/parse.y | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/vhdlpp/parse.y b/vhdlpp/parse.y index 655b26a1f..4629b2eaf 100644 --- a/vhdlpp/parse.y +++ b/vhdlpp/parse.y @@ -464,7 +464,10 @@ component_declaration } ComponentBase*comp = new ComponentBase(name); - if ($4) comp->set_interface($4); + if ($4) { + comp->set_interface($4); + delete $4; + } active_scope->bind_name(name, comp); delete[]$2; if ($7) delete[] $7; @@ -483,6 +486,7 @@ component_instantiation_statement { perm_string iname = lex_strings.make($1); perm_string cname = lex_strings.make($4); ComponentInstantiation*tmp = new ComponentInstantiation(iname, cname, $5); + delete $5; FILE_NAME(tmp, @1); delete[]$1; delete[]$4; @@ -672,7 +676,7 @@ entity_declaration errormsg(@1, "Syntax error in entity clause. Closing name doesn't match.\n"); yyerrok; } - delete $7; + delete[]$7; } } | K_entity error K_end K_entity_opt identifier_opt ';'