summaryrefslogtreecommitdiff
path: root/src/arch/arm
diff options
context:
space:
mode:
authorAli Saidi <Ali.Saidi@ARM.com>2012-03-09 09:59:26 -0500
committerAli Saidi <Ali.Saidi@ARM.com>2012-03-09 09:59:26 -0500
commitec1ef24895de75e8408398492ee8190866650bb5 (patch)
treedf6d86f4c4432d1e694dde1bc3fead80e771d39d /src/arch/arm
parenteaa994e7f6c12f6dc3e17836052f76a5ce9bdc01 (diff)
downloadgem5-ec1ef24895de75e8408398492ee8190866650bb5.tar.xz
ARM: Fix valgrind reported error on O3 that was causing minor stats changes.
Diffstat (limited to 'src/arch/arm')
-rw-r--r--src/arch/arm/linux/atag.hh5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/arch/arm/linux/atag.hh b/src/arch/arm/linux/atag.hh
index b7c37dffd..71271dac2 100644
--- a/src/arch/arm/linux/atag.hh
+++ b/src/arch/arm/linux/atag.hh
@@ -156,7 +156,10 @@ class AtagCmdline : public AtagHeader
delete[] storage;
storage = new uint32_t[size()];
-
+ // Initialize the last byte of memory here beacuse it might be slightly
+ // longer than needed and mis-speculation of the NULL in the O3 CPU can
+ // change stats ever so slightly when that happens.
+ storage[size() - 1] = 0;
strcpy((char*)&storage[2] , s.c_str());
}
AtagCmdline()