x86: Check for more than 2 memory references
authorH.J. Lu <hjl.tools@gmail.com>
Fri, 27 Jul 2018 13:35:09 +0000 (06:35 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Fri, 27 Jul 2018 13:35:09 +0000 (06:35 -0700)
For

movsd (%esi), %ss:(%edi), %ss:(%eax)

we got

[hjl@gnu-tools-1 tmp]$ as -o x.o x.s
x.s: Assembler messages:
x.s:1: Error: too many memory references for `movsd'
munmap_chunk(): invalid pointer
x.s:1: Internal error (Aborted).
Please report this bug.
[hjl@gnu-tools-1 tmp]$

struct _i386_insn has

const seg_entry *seg[2];

3 memory references will overflow the seg array.  We should issue an
error if there are more than 2 memory references.

PR gas/23453
* config/tc-i386.c (parse_operands): Check for more than 2
memory references.
* testsuite/gas/i386/inval.s: Add a movsd test with 3 memory
references.
* testsuite/gas/i386/x86-64-inval.s: Likewise.
* testsuite/gas/i386/inval.l: Updated.
* testsuite/gas/i386/x86-64-inval.l: Likewise.


No differences found