[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2] arm/translate-a64: fix uninitialized variable warning
From: |
pannengyuan |
Subject: |
[PATCH v2] arm/translate-a64: fix uninitialized variable warning |
Date: |
Wed, 8 Jan 2020 10:39:15 +0800 |
From: Pan Nengyuan <address@hidden>
Fixes:
target/arm/translate-a64.c: In function 'disas_crypto_three_reg_sha512':
target/arm/translate-a64.c:13625:9: error: 'genfn' may be used uninitialized in
this function [-Werror=maybe-uninitialized]
genfn(tcg_rd_ptr, tcg_rn_ptr, tcg_rm_ptr);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
qemu/target/arm/translate-a64.c:13609:8: error: 'feature' may be used
uninitialized in this function [-Werror=maybe-uninitialized]
if (!feature) {
Reported-by: Euler Robot <address@hidden>
Signed-off-by: Pan Nengyuan <address@hidden>
---
Changes v2 to v1:
- add a default label to fix uninitialized warnings(suggested by Richard
Henderson)
---
target/arm/translate-a64.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c
index d4bebbe629..63a3d26687 100644
--- a/target/arm/translate-a64.c
+++ b/target/arm/translate-a64.c
@@ -13585,6 +13585,8 @@ static void disas_crypto_three_reg_sha512(DisasContext
*s, uint32_t insn)
feature = dc_isar_feature(aa64_sha3, s);
genfn = NULL;
break;
+ default:
+ g_assert_not_reached();
}
} else {
switch (opcode) {
--
2.21.0.windows.1
- [PATCH v2] arm/translate-a64: fix uninitialized variable warning,
pannengyuan <=