mirror of
https://github.com/radareorg/radare2.git
synced 2025-01-31 18:43:28 +00:00
udis86: Fix 16-bit jump offset decoding
This commit is contained in:
parent
b81aaf3a30
commit
59651353dc
@ -94,7 +94,12 @@ ud_syn_rel_target(struct ud *u, struct ud_operand *opr)
|
||||
const uint64_t trunc_mask = 0xffffffffffffffffull >> (64 - u->opr_mode);
|
||||
switch (opr->size) {
|
||||
case 8 : return (u->pc + opr->lval.sbyte) & trunc_mask;
|
||||
case 16: return (u->pc + opr->lval.sword) & trunc_mask;
|
||||
case 16: {
|
||||
int delta = (opr->lval.sword & trunc_mask);
|
||||
if ((u->pc + delta) > 0xffff)
|
||||
return (u->pc & 0xf0000) + ((u->pc + delta) & 0xffff);
|
||||
return (u->pc + delta);
|
||||
}
|
||||
case 32: return (u->pc + opr->lval.sdword) & trunc_mask;
|
||||
default: UD_ASSERT(!"invalid relative offset size.");
|
||||
return 0ull;
|
||||
|
Loading…
x
Reference in New Issue
Block a user