aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--asm/assemble.c3
-rw-r--r--test/br3392472.asm12
2 files changed, 14 insertions, 1 deletions
diff --git a/asm/assemble.c b/asm/assemble.c
index e24ebdb5..2394e765 100644
--- a/asm/assemble.c
+++ b/asm/assemble.c
@@ -376,7 +376,8 @@ static void out(struct out_data *data)
amax = ofmt->maxbits >> 3; /* Maximum address size in bytes */
if ((ofmt->flags & OFMT_KEEP_ADDR) == 0 && data->tsegment == fixseg &&
data->twrt == NO_SEG) {
- warn_overflow_out(addrval, asize, data->sign);
+ if (asize < (data->bits >> 3))
+ warn_overflow_out(addrval, asize, data->sign);
xdata.q = cpu_to_le64(addrval);
data->data = xdata.b;
data->type = OUT_RAWDATA;
diff --git a/test/br3392472.asm b/test/br3392472.asm
new file mode 100644
index 00000000..7f326eaa
--- /dev/null
+++ b/test/br3392472.asm
@@ -0,0 +1,12 @@
+org 0
+%ifndef SEEK
+ %define SEEK 0
+%endif
+times SEEK - ($ - $$) nop
+jmp near init
+
+%ifndef NUM
+ %define NUM 9956h
+%endif
+times NUM - ($ - $$) db 0
+init: