summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBrad Beckmann <Brad.Beckmann@amd.com>2010-02-10 16:40:54 -0800
committerBrad Beckmann <Brad.Beckmann@amd.com>2010-02-10 16:40:54 -0800
commit64999b43435cfee76823e36c23017efc5584b986 (patch)
tree9b6cc2f66256ffb368a38f331dc3dc0c56351e26 /src
parent714865e4a45048630d4de67ecd18b57cb5ae8c2f (diff)
downloadgem5-64999b43435cfee76823e36c23017efc5584b986.tar.xz
ruby: fixed data block assignment fix
Fixed data block assignment to not delete if not internally allocated.
Diffstat (limited to 'src')
-rw-r--r--src/mem/ruby/common/DataBlock.hh4
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;
}