diff --git a/Changes b/Changes index b77ce5895..2db9184d1 100644 --- a/Changes +++ b/Changes @@ -15,6 +15,8 @@ indicates the contributor was also the author of the fix; Thanks! **** Fix using short parameter names on negative params, bug1022. [Duraid Madina] +**** Fix read-after-free error, bug1031. [Johan Bjork] + * Verilator 3.880 2015-12-19 diff --git a/src/V3Scope.cpp b/src/V3Scope.cpp index 644b5f88d..3498e568a 100644 --- a/src/V3Scope.cpp +++ b/src/V3Scope.cpp @@ -334,7 +334,9 @@ private: nodep->iterateChildren(*this); } else { // A block that was just moved under a scope, Kill it. - nodep->unlinkFrBack()->deleteTree(); VL_DANGLING(nodep); + // Certain nodes can be referenced later in this pass, notably + // an FTaskRef needs to access the FTask to find the cloned task + pushDeletep(nodep->unlinkFrBack()); VL_DANGLING(nodep); } }