From: H.J. Lu Date: Tue, 18 Apr 2006 17:52:37 +0000 (+0000) Subject: gas/ X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=bb8f5920403b60671c504eda876c8283da2f2165;p=binutils-gdb.git gas/ 2006-04-18 H.J. Lu PR gas/2533 * config/tc-i386.c (i386_immediate): Check illegal immediate register operand. gas/testsuite/ 2006-04-18 H.J. Lu PR gas/2533 * gas/i386/inval.s: Add test for illegal immediate register operand. * gas/i386/inval.l: Updated. --- diff --git a/gas/ChangeLog b/gas/ChangeLog index 60798a1947d..c4e9d27986b 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,9 @@ +2006-04-18 H.J. Lu + + PR gas/2533 + * config/tc-i386.c (i386_immediate): Check illegal immediate + register operand. + 2006-04-18 Alan Modra * config/tc-i386.c: Formatting. diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c index c55ffaffb3e..69cede7ad3e 100644 --- a/gas/config/tc-i386.c +++ b/gas/config/tc-i386.c @@ -4127,6 +4127,11 @@ i386_immediate (imm_start) return 0; } #endif + else if (!intel_syntax && exp->X_op == O_register) + { + as_bad (_("illegal immediate register operand %s"), imm_start); + return 0; + } else { /* This is an address. The size of the address will be diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog index bbc6ee8d163..4ab84703e2d 100644 --- a/gas/testsuite/ChangeLog +++ b/gas/testsuite/ChangeLog @@ -1,3 +1,10 @@ +2006-04-18 H.J. Lu + + PR gas/2533 + * gas/i386/inval.s: Add test for illegal immediate register + operand. + * gas/i386/inval.l: Updated. + 2006-04-16 Nick Clifton * gas/arm/arch7.d: Skip test for non-ELF targets. diff --git a/gas/testsuite/gas/i386/inval.l b/gas/testsuite/gas/i386/inval.l index e7894991853..9f32368b7e4 100644 --- a/gas/testsuite/gas/i386/inval.l +++ b/gas/testsuite/gas/i386/inval.l @@ -45,6 +45,7 @@ .*:46: Error: .* .*:47: Error: .* .*:48: Error: .* +.*:49: Error: .* GAS LISTING .* @@ -96,3 +97,4 @@ GAS LISTING .* 46 [ ]* fstb %st\(0\) 47 [ ]* fcompll 28\(%ebp\) 48 [ ]* fldlw \(%eax\) + 49 [ ]* movl \$%ebx,%eax diff --git a/gas/testsuite/gas/i386/inval.s b/gas/testsuite/gas/i386/inval.s index e37a18eac60..1571a2f4fa7 100644 --- a/gas/testsuite/gas/i386/inval.s +++ b/gas/testsuite/gas/i386/inval.s @@ -46,3 +46,4 @@ foo: jaw foo fstb %st(0) fcompll 28(%ebp) fldlw (%eax) + movl $%ebx,%eax