diff options
author | Richard Sandiford <richard.sandiford@arm.com> | 2021-12-03 11:57:17 +0000 |
---|---|---|
committer | Richard Sandiford <richard.sandiford@arm.com> | 2021-12-03 11:57:17 +0000 |
commit | 69ce6091e62c3bc2442c2e9b3b2d689266e96b1f (patch) | |
tree | 647fdb8e22801ee6c78134c94af65e66c61792a1 /opcodes/aarch64-dis.c | |
parent | bf94cfb6318572bc3eece37273140d45279a8768 (diff) | |
download | gdb-69ce6091e62c3bc2442c2e9b3b2d689266e96b1f.zip gdb-69ce6091e62c3bc2442c2e9b3b2d689266e96b1f.tar.gz gdb-69ce6091e62c3bc2442c2e9b3b2d689266e96b1f.tar.bz2 |
aarch64: Fix uninitialised memory
AARCH64_OPDE_EXPECTED_A_AFTER_B and AARCH64_OPDE_A_SHOULD_FOLLOW_B
are not paired with an error string, but we had an assert that the
error was nonnull. Previously this assert was testing uninitialised
memory and so could pass or fail arbitrarily.
opcodes/
* aarch64-opc.c (verify_mops_pme_sequence): Initialize the error
field to null for AARCH64_OPDE_EXPECTED_A_AFTER_B and
AARCH64_OPDE_A_SHOULD_FOLLOW_B.
* aarch64-dis.c (print_verifier_notes): Move assert.
Diffstat (limited to 'opcodes/aarch64-dis.c')
-rw-r--r-- | opcodes/aarch64-dis.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/opcodes/aarch64-dis.c b/opcodes/aarch64-dis.c index fdb87b4..c0fb831 100644 --- a/opcodes/aarch64-dis.c +++ b/opcodes/aarch64-dis.c @@ -3386,7 +3386,6 @@ print_verifier_notes (aarch64_operand_error *detail, /* The output of the verifier cannot be a fatal error, otherwise the assembly would not have succeeded. We can safely ignore these. */ assert (detail->non_fatal); - assert (detail->error); (*info->fprintf_func) (info->stream, " // note: "); switch (detail->kind) @@ -3405,6 +3404,7 @@ print_verifier_notes (aarch64_operand_error *detail, break; default: + assert (detail->error); (*info->fprintf_func) (info->stream, "%s", detail->error); if (detail->index >= 0) (*info->fprintf_func) (info->stream, " at operand %d", |