diff options
author | Brad Beckmann <Brad.Beckmann@amd.com> | 2010-02-10 16:40:54 -0800 |
---|---|---|
committer | Brad Beckmann <Brad.Beckmann@amd.com> | 2010-02-10 16:40:54 -0800 |
commit | 64999b43435cfee76823e36c23017efc5584b986 (patch) | |
tree | 9b6cc2f66256ffb368a38f331dc3dc0c56351e26 /src/mem/ruby | |
parent | 714865e4a45048630d4de67ecd18b57cb5ae8c2f (diff) | |
download | gem5-64999b43435cfee76823e36c23017efc5584b986.tar.xz |
ruby: fixed data block assignment fix
Fixed data block assignment to not delete if not internally allocated.
Diffstat (limited to 'src/mem/ruby')
-rw-r--r-- | src/mem/ruby/common/DataBlock.hh | 4 |
1 files changed, 3 insertions, 1 deletions
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; } |