[commit] x86: fix crash in Intel mode
Jan Beulich
JBeulich@novell.com
Thu Nov 10 15:53:00 GMT 2005
Intel mode operands like [eax+ss] now result in an error message
rather than a crash. Operands like [ss] are ill-formed, too, and no
longer get accepted.
Built and tested on i686-pc-linux-gnu and x86_64-unknown-linux-gnu.
Jan
gas/
2005-11-10 Jan Beulich <jbeulich@novell.com>
* config/tc-i386.c (intel_e11): Don't special-case segment
registers in brackets.
gas/testsuite/
2005-11-10 Jan Beulich <jbeulich@novell.com>
* gas/i386/intelbad.d: Add tests for ill registers in brackets.
* gas/i386/intelbad.l: Adjust.
---
/home/jbeulich/src/binutils/mainline/2005-11-09/gas/config/tc-i386.c 2005-11-07
08:48:26.000000000 +0100
+++ 2005-11-09/gas/config/tc-i386.c 2005-11-10 15:55:52.787567568
+0100
@@ -6644,7 +6644,7 @@ intel_e11 ()
/* No scaling. If this is a memory operand, the register is
either a
base register (first occurrence) or an index register
(second
occurrence). */
- else if (intel_parser.in_bracket && !(reg->reg_type & (SReg2 |
SReg3)))
+ else if (intel_parser.in_bracket)
{
if (!i.base_reg)
---
/home/jbeulich/src/binutils/mainline/2005-11-09/gas/testsuite/gas/i386/intelbad.l 2005-10-21
16:51:03.000000000 +0200
+++ 2005-11-09/gas/testsuite/gas/i386/intelbad.l 2005-11-10
15:55:52.789567264 +0100
@@ -81,31 +81,49 @@
.*:113: Error: .*
.*:114: Error: .*
.*:115: Error: .*
-.*:116: Error: .*
.*:117: Error: .*
.*:118: Error: .*
.*:119: Error: .*
.*:120: Error: .*
.*:121: Error: .*
.*:122: Error: .*
-.*:123: Error: .*
.*:124: Error: .*
.*:125: Error: .*
.*:126: Error: .*
.*:127: Error: .*
.*:128: Error: .*
-#...
.*:129: Error: .*
-#...
-.*:130: Error: .*
.*:131: Error: .*
.*:132: Error: .*
.*:133: Error: .*
+.*:134: Error: .*
.*:135: Error: .*
.*:136: Error: .*
-.*:137: Error: .*
-.*:138: Warning: .*
-.*:139: Warning: .*
+.*:138: Error: .*
+.*:139: Error: .*
+.*:140: Error: .*
.*:141: Error: .*
-.*:142: Warning: .*
.*:142: Error: .*
+.*:143: Error: .*
+.*:144: Error: .*
+.*:145: Error: .*
+.*:147: Error: .*
+.*:148: Error: .*
+.*:149: Error: .*
+.*:150: Error: .*
+.*:151: Error: .*
+#...
+.*:152: Error: .*
+#...
+.*:153: Error: .*
+.*:154: Error: .*
+.*:155: Error: .*
+.*:156: Error: .*
+.*:158: Error: .*
+.*:159: Error: .*
+.*:160: Error: .*
+.*:161: Warning: .*
+.*:162: Warning: .*
+.*:164: Error: .*
+.*:165: Warning: .*
+.*:165: Error: .*
---
/home/jbeulich/src/binutils/mainline/2005-11-09/gas/testsuite/gas/i386/intelbad.s 2005-03-14
13:54:46.000000000 +0100
+++ 2005-11-09/gas/testsuite/gas/i386/intelbad.s 2005-11-10
15:55:52.791566960 +0100
@@ -113,6 +113,28 @@ start:
mov eax, [eax]+2*ecx
mov eax, [[eax]ecx]
mov eax, eax:[ecx]
+
+ mov eax, [ss]
+ mov eax, [st]
+ mov eax, [mm0]
+ mov eax, [xmm0]
+ mov eax, [cr0]
+ mov eax, [dr7]
+
+ mov eax, [ss+edx]
+ mov eax, [st+edx]
+ mov eax, [mm0+edx]
+ mov eax, [xmm0+edx]
+ mov eax, [cr0+edx]
+ mov eax, [dr7+edx]
+
+ mov eax, [edx+ss]
+ mov eax, [edx+st]
+ mov eax, [edx+cr0]
+ mov eax, [edx+dr7]
+ mov eax, [edx+mm0]
+ mov eax, [edx+xmm0]
+
lea eax, [bx+si*1]
lea eax, [bp+si*2]
lea eax, [bx+di*4]
@@ -121,6 +143,7 @@ start:
lea eax, [bp+2*si]
lea eax, [bx+4*di]
lea eax, [bp+8*di]
+
mov eax, [ah]
mov eax, [ax]
mov eax, [eax+bx]
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: binutils-mainline-x86-intel-memaddr.patch
URL: <https://sourceware.org/pipermail/binutils/attachments/20051110/32c733c1/attachment.ksh>
More information about the Binutils
mailing list