diff --git a/Changes b/Changes index a84e08d96..ada6b668e 100644 --- a/Changes +++ b/Changes @@ -10,6 +10,8 @@ indicates the contributor was also the author of the fix; Thanks! *** Report MULTIDRIVEN on memories set in multiple clock domains. +**** Fix core dump with over 100 deep UNOPTFLAT, bug432. [Joe Eiler] + * Verilator 3.831 2012/01/20 diff --git a/src/V3GraphAlg.cpp b/src/V3GraphAlg.cpp index eab558ee8..77c35bee6 100644 --- a/src/V3GraphAlg.cpp +++ b/src/V3GraphAlg.cpp @@ -344,8 +344,9 @@ private: // When we hit ourself again, return the list of all loops if (m_done) return; - m_callTrace.reserve(currentRank+10); // Leave slop for speed - m_callTrace[currentRank++] = vertexp; + // Can't just reserve(), unless we modify size() before setting array directly + while (m_callTrace.size() <= currentRank) m_callTrace.push_back(vertexp); + m_callTrace[currentRank++] = vertexp; if (vertexp->user() == 1) { for (unsigned i=0; i