]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit - gas/config/tc-i386.c
x86: fix operand size checking
authorJan Beulich <jbeulich@novell.com>
Mon, 16 Jul 2018 06:19:21 +0000 (08:19 +0200)
committerJan Beulich <jbeulich@suse.com>
Mon, 16 Jul 2018 06:19:21 +0000 (08:19 +0200)
commit3ac21baa8498d3aa9951f79e2c3336d532eeff7b
tree358ceaf8504b4dc4f751caf5991624e1802f680f
parent4ad422a6354ee4c9a5c6e0236b4f9ded36039bb9
x86: fix operand size checking

Currently mov to/from control, debug, and test register insns accept any
size GPR operand (general pattern: templates with D set and both
operands being registers in distinct register files). This is due to
improper checking of the reverse case, including not informing the
caller whether a straight and/or reverse match was successful.

The helper functions need to be told two indexes: One to index the given
operand types array, and the other to index the template one. The caller
must attempt a further straight match only if the function reported a
straight match (and respectively for reverse matches).
gas/ChangeLog
gas/config/tc-i386.c
gas/testsuite/gas/i386/inval.l
gas/testsuite/gas/i386/inval.s