From: Brad Beckmann Date: Thu, 11 Feb 2010 00:40:54 +0000 (-0800) Subject: ruby: fixed data block assignment fix X-Git-Tag: stable_2012_02_02~1511 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=64999b43435cfee76823e36c23017efc5584b986;p=gem5.git ruby: fixed data block assignment fix Fixed data block assignment to not delete if not internally allocated. --- diff --git a/src/mem/ruby/common/DataBlock.hh b/src/mem/ruby/common/DataBlock.hh index 1d399753e..d62efc72b 100644 --- a/src/mem/ruby/common/DataBlock.hh +++ b/src/mem/ruby/common/DataBlock.hh @@ -82,7 +82,9 @@ bool operator==(const DataBlock& obj1, const DataBlock& obj2); inline void DataBlock::assign(uint8* data) { - delete [] m_data; + if (m_alloc) { + delete [] m_data; + } m_data = data; m_alloc = false; }