diff options
author | H. Peter Anvin <hpa@linux.intel.com> | 2017-10-11 13:14:01 -0700 |
---|---|---|
committer | H. Peter Anvin <hpa@linux.intel.com> | 2017-10-11 13:14:01 -0700 |
commit | 89215e9e371b825f589cb9ebd220a5d97c8f2dc0 (patch) | |
tree | 2b5eb79bbc69ece194738f1119bc63db8dd22176 | |
parent | aaefc7fe6b9e4302ae0a9353695e9680de083913 (diff) | |
download | nasm-89215e9e371b825f589cb9ebd220a5d97c8f2dc0.tar.gz |
Remove duplicate warnings for immediate overflow
For immediates, we had one overflow test in the bytecode interpreter
(in most cases via warn_overflow_opd()) and one in out(); this meant
we got two warnings instead of one every time. Replace with only the
one in out().
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
-rw-r--r-- | asm/assemble.c | 18 |
1 files changed, 0 insertions, 18 deletions
diff --git a/asm/assemble.c b/asm/assemble.c index 7869f8c1..5e7f6fa1 100644 --- a/asm/assemble.c +++ b/asm/assemble.c @@ -302,14 +302,6 @@ static void warn_overflow_const(int64_t data, int size) warn_overflow(size); } -static void warn_overflow_opd(const struct operand *o, int size) -{ - if (absolute_op(o)) { - if (overflow_general(o->offset, size)) - warn_overflow(size); - } -} - static void warn_overflow_out(int64_t data, int size, enum out_sign sign) { bool err; @@ -1580,21 +1572,14 @@ static void gencode(struct out_data *data, insn *ins) break; case4(020): - if (opx->offset < -256 || opx->offset > 255) - nasm_error(ERR_WARNING | ERR_PASS2 | ERR_WARN_NOV, - "byte value exceeds bounds"); out_imm(data, opx, 1, OUT_WRAP); break; case4(024): - if (opx->offset < 0 || opx->offset > 255) - nasm_error(ERR_WARNING | ERR_PASS2 | ERR_WARN_NOV, - "unsigned byte value exceeds bounds"); out_imm(data, opx, 1, OUT_UNSIGNED); break; case4(030): - warn_overflow_opd(opx, 2); out_imm(data, opx, 2, OUT_WRAP); break; @@ -1603,18 +1588,15 @@ static void gencode(struct out_data *data, insn *ins) size = (opx->type & BITS16) ? 2 : 4; else size = (bits == 16) ? 2 : 4; - warn_overflow_opd(opx, size); out_imm(data, opx, size, OUT_WRAP); break; case4(040): - warn_overflow_opd(opx, 4); out_imm(data, opx, 4, OUT_WRAP); break; case4(044): size = ins->addr_size >> 3; - warn_overflow_opd(opx, size); out_imm(data, opx, size, OUT_WRAP); break; |