From 64999b43435cfee76823e36c23017efc5584b986 Mon Sep 17 00:00:00 2001 From: Brad Beckmann Date: Wed, 10 Feb 2010 16:40:54 -0800 Subject: ruby: fixed data block assignment fix Fixed data block assignment to not delete if not internally allocated. --- src/mem/ruby/common/DataBlock.hh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/mem') 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; } -- cgit v1.2.3