arm/translate-a64: fix uninitialized variable warning

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) {

Backports commit c7a5e7910517e2711215a9e869a733ffde696091 from qemu
This commit is contained in:
Pan Nengyuan 2020-01-14 08:46:33 -05:00 committed by Lioncash
parent 31ab6fbd2c
commit 134a026e6b
3 changed files with 5 additions and 3 deletions

View File

@ -13901,6 +13901,8 @@ static void disas_crypto_three_reg_sha512(DisasContext *s, uint32_t insn)
feature = dc_isar_feature(aa64_sha3, s); feature = dc_isar_feature(aa64_sha3, s);
genfn = NULL; genfn = NULL;
break; break;
default:
g_assert_not_reached();
} }
} else { } else {
switch (opcode) { switch (opcode) {

View File

@ -1460,10 +1460,10 @@ static int altcmp(const char *s, const char *e, const char *altstr)
/* search featureset for flag *[s..e), if found set corresponding bit in /* search featureset for flag *[s..e), if found set corresponding bit in
* *pval and return true, otherwise return false * *pval and return true, otherwise return false
*/ */
static bool lookup_feature(uint32_t *pval, const char *s, const char *e, static bool lookup_feature(uint64_t *pval, const char *s, const char *e,
const char **featureset) const char **featureset)
{ {
uint32_t mask; uint64_t mask;
const char **ppc; const char **ppc;
bool found = false; bool found = false;

View File

@ -492,7 +492,7 @@ typedef enum FeatureWord {
FEATURE_WORDS, FEATURE_WORDS,
} FeatureWord; } FeatureWord;
typedef uint32_t FeatureWordArray[FEATURE_WORDS]; typedef uint64_t FeatureWordArray[FEATURE_WORDS];
/* cpuid_features bits */ /* cpuid_features bits */
#define CPUID_FP87 (1U << 0) #define CPUID_FP87 (1U << 0)