Giacomo Travaglini has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/23526 )

Change subject: arch: Do value-initialization for MemOperand
......................................................................

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 <[email protected]>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23526
Tested-by: kokoro <[email protected]>
Tested-by: Gem5 Cloud Project GCB service account <[email protected]>
Reviewed-by: Gabe Black <[email protected]>
Maintainer: Gabe Black <[email protected]>
---
M src/arch/isa_parser.py
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Gabe Black: Looks good to me, approved; Looks good to me, approved
  kokoro: Regressions pass
  Gem5 Cloud Project GCB service account: Regressions pass



diff --git a/src/arch/isa_parser.py b/src/arch/isa_parser.py
index 4f69a3f..86f5089 100755
--- a/src/arch/isa_parser.py
+++ b/src/arch/isa_parser.py
@@ -1076,7 +1076,7 @@

     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:

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/23526
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I55a5b8f047b8e691529807b61d38f0d47fcfe61e
Gerrit-Change-Number: 23526
Gerrit-PatchSet: 9
Gerrit-Owner: Giacomo Travaglini <[email protected]>
Gerrit-Reviewer: Bobby R. Bruce <[email protected]>
Gerrit-Reviewer: Brandon Potter <[email protected]>
Gerrit-Reviewer: Gabe Black <[email protected]>
Gerrit-Reviewer: Gem5 Cloud Project GCB service account <[email protected]>
Gerrit-Reviewer: Giacomo Travaglini <[email protected]>
Gerrit-Reviewer: Jason Lowe-Power <[email protected]>
Gerrit-Reviewer: kokoro <[email protected]>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to