From: Giacomo Travaglini Date: Mon, 9 Dec 2019 14:00:47 +0000 (+0000) Subject: arch: Do value-initialization for MemOperand X-Git-Tag: develop-gem5-snapshot~701 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d29349ead6384cdc1b28236ca3eeb1d79914a66f;p=gem5.git arch: Do value-initialization for MemOperand With this patch we are properly initializing the MemOperand variable, with value-initialization. Prior to this patch, the variable was simply default-initialized. For a native type, this means the variable is undefined. With value initialization we are sure the variable is not undefined and the compiler doesn't complain about it. JIRA: https://gem5.atlassian.net/browse/GEM5-196 Change-Id: I55a5b8f047b8e691529807b61d38f0d47fcfe61e Signed-off-by: Giacomo Travaglini Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23526 Tested-by: kokoro Tested-by: Gem5 Cloud Project GCB service account <345032938727@cloudbuild.gserviceaccount.com> Reviewed-by: Gabe Black Maintainer: Gabe Black --- diff --git a/src/arch/isa_parser.py b/src/arch/isa_parser.py index 4f69a3f4a..86f50892f 100755 --- a/src/arch/isa_parser.py +++ b/src/arch/isa_parser.py @@ -1076,7 +1076,7 @@ class MemOperand(Operand): def makeDecl(self): # Declare memory data variable. - return '%s %s;\n' % (self.ctype, self.base_name) + return '%s %s = {};\n' % (self.ctype, self.base_name) def makeRead(self, predRead): if self.read_code != None: