From 787fb4805583872d5a9dbfdea598a8912d8d82bd Mon Sep 17 00:00:00 2001 From: Tony Gutierrez Date: Wed, 8 Jul 2020 12:54:06 -0400 Subject: [PATCH] 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 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/31094 Reviewed-by: Giacomo Travaglini Maintainer: Giacomo Travaglini Tested-by: kokoro --- src/arch/arm/pauth_helpers.cc | 56 +++++++++++++++++------------------ 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/src/arch/arm/pauth_helpers.cc b/src/arch/arm/pauth_helpers.cc index c88795f0f..7424eb3c9 100644 --- a/src/arch/arm/pauth_helpers.cc +++ b/src/arch/arm/pauth_helpers.cc @@ -286,9 +286,9 @@ ArmISA::authDA(ThreadContext * tc, uint64_t X, uint64_t Y, uint64_t* out) 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 @@ ArmISA::authDB(ThreadContext* tc, uint64_t X, uint64_t Y, uint64_t* out) 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 @@ ArmISA::authIA(ThreadContext * tc, uint64_t X, uint64_t Y, uint64_t* out) 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 @@ ArmISA::authIB(ThreadContext *tc, uint64_t X, uint64_t Y, uint64_t* out) 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 @@ ArmISA::authIB(ThreadContext *tc, uint64_t X, uint64_t Y, uint64_t* out) 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 @@ ArmISA::addPACDA(ThreadContext* tc, uint64_t X, uint64_t Y, uint64_t* out) 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 @@ ArmISA::addPACDB(ThreadContext* tc, uint64_t X, uint64_t Y, uint64_t* out) 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 @@ ArmISA::addPACGA(ThreadContext * tc, uint64_t X, uint64_t Y, uint64_t* out) 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 @@ ArmISA::addPACIA(ThreadContext * tc, uint64_t X, uint64_t Y, uint64_t* out){ 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 @@ ArmISA::addPACIB(ThreadContext* tc, uint64_t X, uint64_t Y, uint64_t* out){ 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; -- 2.30.2