]> granicus.if.org Git - yasm/commitdiff
Remove obsolete overflow check in EA displacements (causing error instead of
authorPeter Johnson <peter@tortall.net>
Sun, 19 Oct 2003 18:38:03 +0000 (18:38 -0000)
committerPeter Johnson <peter@tortall.net>
Sun, 19 Oct 2003 18:38:03 +0000 (18:38 -0000)
warning on size overflow).
Bugzilla Bug 18
Reported by Jeff Lawson <jlawson-yasm@bovine.net>

svn path=/trunk/yasm/; revision=1071

modules/arch/x86/tests/Makefile.inc
modules/arch/x86/tests/ea-over.asm [new file with mode: 0644]
modules/arch/x86/tests/ea-over.errwarn [new file with mode: 0644]
modules/arch/x86/tests/ea-over.hex [new file with mode: 0644]
modules/arch/x86/x86expr.c

index 0aae20c5f4f76cdb800550fcf7317d4f1bee73ee..24f4dd684a1b97ba3f3ebbda08a7ccae278317d6 100644 (file)
@@ -18,6 +18,9 @@ EXTRA_DIST += modules/arch/x86/tests/cpubasic-err.asm
 EXTRA_DIST += modules/arch/x86/tests/cpubasic-err.errwarn
 EXTRA_DIST += modules/arch/x86/tests/div-err.asm
 EXTRA_DIST += modules/arch/x86/tests/div-err.errwarn
+EXTRA_DIST += modules/arch/x86/tests/ea-over.asm
+EXTRA_DIST += modules/arch/x86/tests/ea-over.errwarn
+EXTRA_DIST += modules/arch/x86/tests/ea-over.hex
 EXTRA_DIST += modules/arch/x86/tests/effaddr.asm
 EXTRA_DIST += modules/arch/x86/tests/effaddr.errwarn
 EXTRA_DIST += modules/arch/x86/tests/effaddr.hex
diff --git a/modules/arch/x86/tests/ea-over.asm b/modules/arch/x86/tests/ea-over.asm
new file mode 100644 (file)
index 0000000..1318571
--- /dev/null
@@ -0,0 +1,4 @@
+[bits 32]
+%define P 0xB7E15163
+%define Q 0x9E3779B9
+lea eax,[eax+P+Q]
diff --git a/modules/arch/x86/tests/ea-over.errwarn b/modules/arch/x86/tests/ea-over.errwarn
new file mode 100644 (file)
index 0000000..6a622a9
--- /dev/null
@@ -0,0 +1 @@
+-:4: warning: value does not fit in 32 bit field
diff --git a/modules/arch/x86/tests/ea-over.hex b/modules/arch/x86/tests/ea-over.hex
new file mode 100644 (file)
index 0000000..7a32106
--- /dev/null
@@ -0,0 +1,6 @@
+8d 
+80 
+1c 
+cb 
+18 
+56 
index aafcd5f703b78037cb2fc8c6bc4ecb5e0c3e3d80..5c917537b089cd707f7f5272a0c7e6b3ea9f4e5f 100644 (file)
@@ -438,15 +438,6 @@ x86_checkea_calc_displen(yasm_expr **ep, unsigned int wordsize, int noreg,
                break;
            }   
 
-           /* make sure the displacement will fit in 16/32 bits if unsigned,
-            * and 8 bits if signed.
-            */
-           if (!yasm_intnum_check_size(intn, (size_t)wordsize*8, 0, 0) &&
-               !yasm_intnum_check_size(intn, 8, 0, 1)) {
-               yasm__error(e->line, N_("invalid effective address"));
-               return 1;
-           }
-
            /* don't try to find out what size displacement we have if
             * displen is known.
             */
@@ -459,9 +450,6 @@ x86_checkea_calc_displen(yasm_expr **ep, unsigned int wordsize, int noreg,
                break;
            }
 
-           /* Don't worry about overflows here (it's already guaranteed
-            * to be 16/32 or 8 bits).
-            */
            dispval = yasm_intnum_get_int(intn);
 
            /* Figure out what size displacement we will have. */