From 1140b8ebe368e7017448f22fb04648554217eb82 Mon Sep 17 00:00:00 2001 From: Edmund Grimley Evans Date: Wed, 27 Apr 2016 08:25:24 +0000 Subject: [PATCH] i#1569 AArch64: Change prototype of decode_sizeof. Condition on last argument is changed from _IF_X64 to _IF_X86_64. Review-URL: https://codereview.appspot.com/293230043 --- core/arch/aarch64/decode.c | 3 +-- core/arch/decode_fast.h | 2 +- core/arch/disassemble_shared.c | 2 +- core/arch/instr_shared.c | 4 ++-- core/unix/signal.c | 4 ++-- 5 files changed, 7 insertions(+), 8 deletions(-) diff --git a/core/arch/aarch64/decode.c b/core/arch/aarch64/decode.c index 741af889d60..821a0e8c1ca 100644 --- a/core/arch/aarch64/decode.c +++ b/core/arch/aarch64/decode.c @@ -226,8 +226,7 @@ decode_next_pc(dcontext_t *dcontext, byte *pc) } int -decode_sizeof(dcontext_t *dcontext, byte *pc, int *num_prefixes - _IF_X64(uint *rip_rel_pos)) +decode_sizeof(dcontext_t *dcontext, byte *pc, int *num_prefixes) { ASSERT_NOT_IMPLEMENTED(false); /* FIXME i#1569 */ return 0; diff --git a/core/arch/decode_fast.h b/core/arch/decode_fast.h index 84bac9d6669..b61720acf36 100644 --- a/core/arch/decode_fast.h +++ b/core/arch/decode_fast.h @@ -53,7 +53,7 @@ DR_API */ int decode_sizeof(dcontext_t *dcontext, byte *pc, int *num_prefixes - _IF_X64(uint *rip_rel_pos)); + _IF_X86_64(uint *rip_rel_pos)); DR_API /** diff --git a/core/arch/disassemble_shared.c b/core/arch/disassemble_shared.c index 94f3a4d0565..dd9ada72e6a 100644 --- a/core/arch/disassemble_shared.c +++ b/core/arch/disassemble_shared.c @@ -1449,7 +1449,7 @@ instrlist_disassemble(dcontext_t *dcontext, level = 3; else if (instr_opcode_valid(instr)) level = 2; - else if (decode_sizeof(dcontext, addr, NULL _IF_X64(NULL)) == len) + else if (decode_sizeof(dcontext, addr, NULL _IF_X86_64(NULL)) == len) level = 1; else level = 0; diff --git a/core/arch/instr_shared.c b/core/arch/instr_shared.c index f04e8f19089..a250e042f1d 100644 --- a/core/arch/instr_shared.c +++ b/core/arch/instr_shared.c @@ -1292,7 +1292,7 @@ instr_expand(dcontext_t *dcontext, instrlist_t *ilist, instr_t *instr) CLIENT_ASSERT(!instr_operands_valid(instr), "instr_expand: opnds are already valid"); CLIENT_ASSERT(instr_raw_bits_valid(instr), "instr_expand: raw bits are invalid"); curbytes = instr->bytes; - if ((uint)decode_sizeof(dcontext, curbytes, NULL _IF_X64(NULL)) == instr->length) { + if ((uint)decode_sizeof(dcontext, curbytes, NULL _IF_X86_64(NULL)) == instr->length) { dr_set_isa_mode(dcontext, old_mode, NULL); return instr; /* Level 1 */ } @@ -1383,7 +1383,7 @@ instr_is_level_0(instr_t *instr) CLIENT_ASSERT(instr_raw_bits_valid(instr), "instr_is_level_0: raw bits are invalid"); dr_set_isa_mode(dcontext, instr_get_isa_mode(instr), &old_mode); - if ((uint)decode_sizeof(dcontext, instr->bytes, NULL _IF_X64(NULL)) == + if ((uint)decode_sizeof(dcontext, instr->bytes, NULL _IF_X86_64(NULL)) == instr->length) { dr_set_isa_mode(dcontext, old_mode, NULL); return false; /* Level 1 */ diff --git a/core/unix/signal.c b/core/unix/signal.c index cf94ebe0b6c..e079216c43b 100644 --- a/core/unix/signal.c +++ b/core/unix/signal.c @@ -4967,10 +4967,10 @@ execute_default_action(dcontext_t *dcontext, int sig, sigframe_rt_t *frame, */ ASSERT(sc_orig != NULL); instr_sz = decode_sizeof(dcontext, (byte *) sc_orig->SC_XIP, - NULL _IF_X64(NULL)); + NULL _IF_X86_64(NULL)); if (instr_sz != 0 && pc != NULL && /* avoid crash on xl8 failure (i#1699) */ - instr_sz == decode_sizeof(dcontext, pc, NULL _IF_X64(NULL)) && + instr_sz == decode_sizeof(dcontext, pc, NULL _IF_X86_64(NULL)) && memcmp(pc, (byte *) sc_orig->SC_XIP, instr_sz) == 0) { /* the app instr matches the cache instr; cleanup and raise the * the signal in the app context