Hello Tony Gutierrez,

I'd like you to do a code review. Please visit

    https://gem5-review.googlesource.com/c/public/gem5/+/31094

to review the following change.


Change subject: arch-arm: Initialized some variables
......................................................................

arch-arm: Initialized some variables

Some of the variables in pauth_helpers.cc
are uninitialized in certain control paths
which causes a compiler warning. We initialize
these to false since they should be updated
to the correct value in all valid code paths.

Change-Id: If34d7daaf2404c2cf014c7b4c0c2f979580f36b9
---
M src/arch/arm/pauth_helpers.cc
1 file changed, 28 insertions(+), 28 deletions(-)



diff --git a/src/arch/arm/pauth_helpers.cc b/src/arch/arm/pauth_helpers.cc
index c88795f..e996fd5 100644
--- a/src/arch/arm/pauth_helpers.cc
+++ b/src/arch/arm/pauth_helpers.cc
@@ -286,9 +286,9 @@
   using the same algorithm and key as AddPACDA().
 */

-    bool trapEL2;
-    bool trapEL3;
-    bool enable;
+    bool trapEL2(false);
+    bool trapEL3(false);
+    bool enable(false);

     uint64_t hi_key= tc->readMiscReg(MISCREG_APDAKeyHi_EL1);
     uint64_t lo_key= tc->readMiscReg(MISCREG_APDAKeyLo_EL1);
@@ -354,9 +354,9 @@
   using the same algorithm and key as AddPACDA().
 */

-    bool trapEL2;
-    bool trapEL3;
-    bool enable;
+    bool trapEL2(false);
+    bool trapEL3(false);
+    bool enable(false);

     uint64_t hi_key= tc->readMiscReg(MISCREG_APDBKeyHi_EL1);
     uint64_t lo_key= tc->readMiscReg(MISCREG_APDBKeyLo_EL1);
@@ -424,9 +424,9 @@
   using the same algorithm and key as AddPACDA().
 */

-    bool trapEL2;
-    bool trapEL3;
-    bool enable;
+    bool trapEL2(false);
+    bool trapEL3(false);
+    bool enable(false);

     uint64_t hi_key= tc->readMiscReg(MISCREG_APIAKeyHi_EL1);
     uint64_t lo_key= tc->readMiscReg(MISCREG_APIAKeyLo_EL1);
@@ -498,9 +498,9 @@
   using the same algorithm and key as AddPACDA().
 */

-    bool trapEL2;
-    bool trapEL3;
-    bool enable;
+    bool trapEL2(false);
+    bool trapEL3(false);
+    bool enable(false);

     uint64_t hi_key= tc->readMiscReg(MISCREG_APIBKeyHi_EL1);
     uint64_t lo_key= tc->readMiscReg(MISCREG_APIBKeyLo_EL1);
@@ -566,9 +566,9 @@
 Fault
 ArmISA::addPACDA(ThreadContext* tc, uint64_t X, uint64_t Y, uint64_t* out)
 {
-    bool trapEL2;
-    bool trapEL3;
-    bool enable;
+    bool trapEL2(false);
+    bool trapEL3(false);
+    bool enable(false);

     uint64_t hi_key= tc->readMiscReg(MISCREG_APDAKeyHi_EL1);
     uint64_t lo_key= tc->readMiscReg(MISCREG_APDAKeyLo_EL1);
@@ -630,9 +630,9 @@
 Fault
 ArmISA::addPACDB(ThreadContext* tc, uint64_t X, uint64_t Y, uint64_t* out)
 {
-    bool trapEL2;
-    bool trapEL3;
-    bool enable;
+    bool trapEL2(false);
+    bool trapEL3(false);
+    bool enable(false);

     uint64_t hi_key= tc->readMiscReg(MISCREG_APDBKeyHi_EL1);
     uint64_t lo_key= tc->readMiscReg(MISCREG_APDBKeyLo_EL1);
@@ -691,8 +691,8 @@
 Fault
 ArmISA::addPACGA(ThreadContext * tc, uint64_t X, uint64_t Y, uint64_t* out)
 {
-    bool trapEL2;
-    bool trapEL3;
+    bool trapEL2(false);
+    bool trapEL3(false);

     uint64_t hi_key= tc->readMiscReg(MISCREG_APGAKeyHi_EL1);
     uint64_t lo_key= tc->readMiscReg(MISCREG_APGAKeyLo_EL1);
@@ -738,9 +738,9 @@

 Fault
ArmISA::addPACIA(ThreadContext * tc, uint64_t X, uint64_t Y, uint64_t* out){
-    bool trapEL2;
-    bool trapEL3;
-    bool enable;
+    bool trapEL2(false);
+    bool trapEL3(false);
+    bool enable(false);

     uint64_t hi_key= tc->readMiscReg(MISCREG_APIAKeyHi_EL1);
     uint64_t lo_key= tc->readMiscReg(MISCREG_APIAKeyLo_EL1);
@@ -797,9 +797,9 @@

 Fault
 ArmISA::addPACIB(ThreadContext* tc, uint64_t X, uint64_t Y, uint64_t* out){
-    bool trapEL2;
-    bool trapEL3;
-    bool enable;
+    bool trapEL2(false);
+    bool trapEL3(false);
+    bool enable(false);

     uint64_t hi_key= tc->readMiscReg(MISCREG_APIBKeyHi_EL1);
     uint64_t lo_key= tc->readMiscReg(MISCREG_APIBKeyLo_EL1);
@@ -859,8 +859,8 @@

 Fault
 ArmISA::stripPAC(ThreadContext* tc, uint64_t A, bool data, uint64_t* out){
-    bool trapEL2;
-    bool trapEL3;
+    bool trapEL2(false);
+    bool trapEL3(false);

     uint64_t ptr;


--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/31094
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: If34d7daaf2404c2cf014c7b4c0c2f979580f36b9
Gerrit-Change-Number: 31094
Gerrit-PatchSet: 1
Gerrit-Owner: Anthony Gutierrez <anthony.gutier...@amd.com>
Gerrit-Reviewer: Tony Gutierrez <anthony.gutier...@amd.com>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to