summaryrefslogtreecommitdiff
path: root/src/mem/ruby/common/DataBlock.hh
diff options
context:
space:
mode:
authorJason Power <power.jg@gmail.com>2012-08-28 17:57:51 -0500
committerJason Power <power.jg@gmail.com>2012-08-28 17:57:51 -0500
commit494f6a858e47db3e5352468f504e82af01b931f9 (patch)
tree77d446867e1050b09f7aa251e64f150e7a856cf2 /src/mem/ruby/common/DataBlock.hh
parent0cacf7e8178defce4063b7cfc8a592c595f56fa2 (diff)
downloadgem5-494f6a858e47db3e5352468f504e82af01b931f9.tar.xz
Ruby: Correct DataBlock =operator
The =operator for the DataBlock class was incorrectly interpreting the class member m_alloc. This variable stands for whether the assigned memory for the data block needs to be freed or not by the class itself. It seems that the =operator interpreted the variable as whether the memory is assigned to the data block. This wrong interpretation was causing values not to propagate to RubySystem::m_mem_vec_ptr. This caused major issues with restoring from checkpoints when using a protocol which verified that the cache data was consistent with the backing store (i.e. MOESI-hammer).
Diffstat (limited to 'src/mem/ruby/common/DataBlock.hh')
-rw-r--r--src/mem/ruby/common/DataBlock.hh2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/mem/ruby/common/DataBlock.hh b/src/mem/ruby/common/DataBlock.hh
index 7bd92710d..0ab4cfc01 100644
--- a/src/mem/ruby/common/DataBlock.hh
+++ b/src/mem/ruby/common/DataBlock.hh
@@ -29,6 +29,7 @@
#ifndef __MEM_RUBY_COMMON_DATABLOCK_HH__
#define __MEM_RUBY_COMMON_DATABLOCK_HH__
+#include <cassert>
#include <iomanip>
#include <iostream>
@@ -72,6 +73,7 @@ class DataBlock
inline void
DataBlock::assign(uint8* data)
{
+ assert(data != NULL);
if (m_alloc) {
delete [] m_data;
}