Fix read-after-free error detected by valgrind, bug1031.

Signed-off-by: Wilson Snyder <wsnyder@wsnyder.org>
This commit is contained in:
Johan Bjork 2016-02-04 18:34:08 -05:00 committed by Wilson Snyder
parent b488666c1e
commit be74806044
2 changed files with 5 additions and 1 deletions

View File

@ -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

View File

@ -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);
}
}