From 5fad6666789de7ca98a51892cce3b987f3a5c788 Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Tue, 29 May 2012 23:16:13 -0400 Subject: [PATCH] Fix +: and -: memory leak. --- src/V3WidthSel.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/V3WidthSel.cpp b/src/V3WidthSel.cpp index 65f87cd02..564bf8499 100644 --- a/src/V3WidthSel.cpp +++ b/src/V3WidthSel.cpp @@ -345,6 +345,10 @@ private: } UINFO(6," new "<replaceWith(newp); pushDeletep(nodep); nodep=NULL; + // delete whataver we didn't use in reconstruction + if (!fromp->backp()) pushDeletep(fromp); fromp=NULL; + if (!rhsp->backp()) pushDeletep(rhsp); rhsp=NULL; + if (!widthp->backp()) pushDeletep(widthp); widthp=NULL; } else { // NULL=bad extract, or unknown node type nodep->v3error("Illegal +: or -: select; variable already selected, or bad dimension");