[PATCH 02/23] aarch64: Fix use of wrong zero enum value
Alice Carlotti
alice.carlotti@arm.com
Thu May 7 16:08:46 GMT 2026
aarch64_get_expected_qualifier was incorrectly comparing an
aarch64_opnd_qualifier_t against AARCH64_OPND_NIL instead of
AARCH64_OPND_QLF_NIL (these are the zero values of two different enums).
A previous patch incorrectly addressed the type mismatch by casting the
qualifier to (enum aarch64_opnd).
Fix it properly by removing the cast and updating the comparison to use
AARCH64_OPND_QLF_NIL.
diff --git a/opcodes/aarch64-opc.c b/opcodes/aarch64-opc.c
index a50b8fd0fb81396919c26efcbac8fb6e64f39f74..3586a2d9146411cb2324cd379356dd4d2e9ca75a 100644
--- a/opcodes/aarch64-opc.c
+++ b/opcodes/aarch64-opc.c
@@ -780,9 +780,9 @@ aarch64_get_expected_qualifier (const aarch64_opnd_qualifier_seq_t *qseq_list,
it can mean no qualifier for the operand, or the qualifer sequence is
not in use (when all qualifiers in the sequence are NILs), we have to
handle this special case here. */
- if (((enum aarch64_opnd) known_qlf) == AARCH64_OPND_NIL)
+ if (known_qlf == AARCH64_OPND_QLF_NIL)
{
- assert (((enum aarch64_opnd) qseq_list[0][known_idx]) == AARCH64_OPND_NIL);
+ assert (qseq_list[0][known_idx] == AARCH64_OPND_QLF_NIL);
return qseq_list[0][idx];
}
More information about the Binutils
mailing list