From 30aa1802118d01c6db3180dfddaadc514b8afa97 Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Sat, 5 Jan 2019 06:53:26 -0500 Subject: [PATCH] Internals: Use pushDelete for empty unrolls. Theoretical problem only. --- src/V3Unroll.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/V3Unroll.cpp b/src/V3Unroll.cpp index c1d436f53..3863d5abd 100644 --- a/src/V3Unroll.cpp +++ b/src/V3Unroll.cpp @@ -404,11 +404,11 @@ private: // we'd need to initialize the variable to the initial // condition, but they'll become while's which can be // deleted by V3Const. - nodep->unlinkFrBack()->deleteTree(); VL_DANGLING(nodep); - } else if (forUnrollCheck(nodep, nodep->initsp(), - NULL, nodep->condp(), - nodep->incsp(), nodep->bodysp())) { - pushDeletep(nodep); VL_DANGLING(nodep); // Did replacement + pushDeletep(nodep->unlinkFrBack()); VL_DANGLING(nodep); + } else if (forUnrollCheck(nodep, nodep->initsp(), + NULL, nodep->condp(), + nodep->incsp(), nodep->bodysp())) { + pushDeletep(nodep); VL_DANGLING(nodep); // Did replacement } else { nodep->v3error("For loop doesn't have genvar index, or is malformed"); }