Skip to content

Commit

Permalink
i#1569 AArch64: Change prototype of decode_sizeof.
Browse files Browse the repository at this point in the history
Condition on last argument is changed from _IF_X64 to _IF_X86_64.

Review-URL: https://codereview.appspot.com/293230043
  • Loading branch information
egrimley-arm committed Apr 27, 2016
1 parent e0ed364 commit 1140b8e
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 8 deletions.
3 changes: 1 addition & 2 deletions core/arch/aarch64/decode.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion core/arch/decode_fast.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
/**
Expand Down
2 changes: 1 addition & 1 deletion core/arch/disassemble_shared.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions core/arch/instr_shared.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
}
Expand Down Expand Up @@ -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 */
Expand Down
4 changes: 2 additions & 2 deletions core/unix/signal.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1140b8e

Please sign in to comment.