diff options
author | H. Peter Anvin <hpa@linux.intel.com> | 2017-03-28 15:52:58 -0700 |
---|---|---|
committer | H. Peter Anvin <hpa@linux.intel.com> | 2017-03-28 15:54:15 -0700 |
commit | d9bc244f8a4ff9c0756c96345192b2fa3ed2d1c1 (patch) | |
tree | a433c5b77cc8cbfeb8a71627d93ef81e69e4b243 | |
parent | 37d01d1a895825ae74a06c23d392fa3d79c95f06 (diff) | |
download | nasm-d9bc244f8a4ff9c0756c96345192b2fa3ed2d1c1.tar.gz |
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>
-rw-r--r-- | asm/assemble.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/asm/assemble.c b/asm/assemble.c index 33e593e3..7902c6cc 100644 --- a/asm/assemble.c +++ b/asm/assemble.c @@ -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); } } } |