summaryrefslogtreecommitdiff
path: root/opcodes/aarch64-dis.c
diff options
context:
space:
mode:
authorTamar Christina <tamar.christina@arm.com>2018-10-03 18:37:07 +0100
committerTamar Christina <tamar.christina@arm.com>2018-10-03 18:40:48 +0100
commit755b748fd9fbee8cad2e55535d23298e8ac76b15 (patch)
treeb70510477152c03244207ba779875866c061c3da /opcodes/aarch64-dis.c
parent1d4823943d92e7fccb0616f885c029d9952cfb0e (diff)
downloadbinutils-gdb-755b748fd9fbee8cad2e55535d23298e8ac76b15.tar.gz
AArch64: Refactor verifiers to make more general.
The current verifiers only take an instruction description and encoded value as arguments. This was enough when the verifiers only needed to do simple checking but it's insufficient for the purposes of validating instruction sequences. This patch adds the required arguments and also a flag to allow a verifier to distinguish between whether it's being run during encoding or decoding. It also allows for errors and warnings to be returned by a verifier instead of a simple pass/fail. include/ * opcode/aarch64.h (struct aarch64_opcode): Expand verifiers to take more arguments. opcodes/ * aarch64-dis.c (aarch64_opcode_decode): Update verifier call. * aarch64-opc.c (verify_ldpsw): Update arguments.
Diffstat (limited to 'opcodes/aarch64-dis.c')
-rw-r--r--opcodes/aarch64-dis.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/opcodes/aarch64-dis.c b/opcodes/aarch64-dis.c
index c08c82fb995..373ddae8a12 100644
--- a/opcodes/aarch64-dis.c
+++ b/opcodes/aarch64-dis.c
@@ -2885,7 +2885,8 @@ aarch64_opcode_decode (const aarch64_opcode *opcode, const aarch64_insn code,
}
/* If the opcode has a verifier, then check it now. */
- if (opcode->verifier && ! opcode->verifier (opcode, code))
+ if (opcode->verifier
+ && opcode->verifier (inst, code, 0, FALSE, errors, NULL) != ERR_OK)
{
DEBUG_TRACE ("operand verifier FAIL");
goto decode_fail;