From ec1ef24895de75e8408398492ee8190866650bb5 Mon Sep 17 00:00:00 2001 From: Ali Saidi Date: Fri, 9 Mar 2012 09:59:26 -0500 Subject: [PATCH] ARM: Fix valgrind reported error on O3 that was causing minor stats changes. --- src/arch/arm/linux/atag.hh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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() -- 2.30.2