assemble.c: if a displacement is large enough, we may wrap

If a displacement is as large as the address size currently in use
(which is the norm except for 64-bit code), then we should use
OUT_WRAP rather than OUT_UNSIGNED; the sign doesn't matter at all.

This resolves BR 3392391.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
This commit is contained in:
H. Peter Anvin 2017-03-28 15:52:58 -07:00
parent 37d01d1a89
commit d9bc244f8a

View File

@ -1948,7 +1948,8 @@ static void gencode(struct out_data *data, insn *ins)
warn_overflow(ea_data.bytes);
out_imm(data, opy, ea_data.bytes,
(asize > ea_data.bytes) ? OUT_SIGNED : OUT_UNSIGNED);
(asize > ea_data.bytes)
? OUT_SIGNED : OUT_WRAP);
}
}
}