From: Ali Saidi Date: Fri, 9 Mar 2012 14:59:26 +0000 (-0500) Subject: ARM: Fix valgrind reported error on O3 that was causing minor stats changes. X-Git-Tag: stable_2012_06_28~189 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ec1ef24895de75e8408398492ee8190866650bb5;p=gem5.git ARM: Fix valgrind reported error on O3 that was causing minor stats changes. --- 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()