]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Fix an internal error in GAS when assembling a bogus piece of source code.
authorNick Clifton <nickc@redhat.com>
Wed, 29 Apr 2015 16:09:05 +0000 (17:09 +0100)
committerNick Clifton <nickc@redhat.com>
Wed, 29 Apr 2015 16:09:05 +0000 (17:09 +0100)
gas PR 18256
* config/tc-arm.c (encode_arm_cp_address): Issue an error message
if the operand is neither a register nor a vector.

tests * gas/arm/pr18256.s: New file: Test case.
* gas/arm/pr18256.l: New file: Expected assembler output.
* gas/arm/pr18256.d: New file: Test driver.

gas/ChangeLog
gas/config/tc-arm.c
gas/testsuite/ChangeLog
gas/testsuite/gas/arm/pr18256.d [new file with mode: 0644]
gas/testsuite/gas/arm/pr18256.l [new file with mode: 0644]
gas/testsuite/gas/arm/pr18256.s [new file with mode: 0644]

index 1affd227fb699efe00cd26aa3b9aa6e7500002cf..9ba6648bd48e3b5130ab5819fbad72f23ad3201f 100644 (file)
@@ -1,3 +1,9 @@
+2015-04-29  Nick Clifton  <nickc@redhat.com>
+
+       PR 18256
+       * config/tc-arm.c (encode_arm_cp_address): Issue an error message
+       if the operand is neither a register nor a vector.
+
 2015-04-29  Nick Clifton  <nickc@redhat.com>
 
        * doc/as.texinfo (Set): Note that a symbol cannot be set multiple
index 5ce4da533769d0e8939ba3fbe134efb082a42f67..bc8f7758bc6b80503c00cf3f92ce50e5ddd2e14c 100644 (file)
@@ -7891,7 +7891,12 @@ encode_arm_cp_address (int i, int wb_ok, int unind_ok, int reloc_override)
 {
   if (!inst.operands[i].isreg)
     {
-      gas_assert (inst.operands[0].isvec);
+      /* PR 18256 */
+      if (! inst.operands[0].isvec)
+       {
+         inst.error = _("invalid co-processor operand");
+         return FAIL;
+       }
       if (move_or_literal_pool (0, CONST_VEC, /*mode_3=*/FALSE))
        return SUCCESS;
     }
index d0167bef8e000e5a922ae0510ae3222a9d2880fb..aed518ab5ab8b0d0b384181516b42b006e14b824 100644 (file)
@@ -1,3 +1,10 @@
+2015-04-29  Nick Clifton  <nickc@redhat.com>
+
+       PR gas/18265
+       * gas/arm/pr18256.s: New file: Test case.
+       * gas/arm/pr18256.l: New file: Expected assembler output.
+       * gas/arm/pr18256.d: New file: Test driver.
+
 2015-04-28  Renlin Li  <renlin.li@arm.com>
 
        * gas/arm/thumb2_vpool_be.d: Adjust the desired output.
diff --git a/gas/testsuite/gas/arm/pr18256.d b/gas/testsuite/gas/arm/pr18256.d
new file mode 100644 (file)
index 0000000..0c5e514
--- /dev/null
@@ -0,0 +1,9 @@
+# name: PR18256 - Bad code triggers internal error
+#as:
+#error-output: pr18256.l
+
+
+
+
+
+
diff --git a/gas/testsuite/gas/arm/pr18256.l b/gas/testsuite/gas/arm/pr18256.l
new file mode 100644 (file)
index 0000000..b68e914
--- /dev/null
@@ -0,0 +1,2 @@
+[^:]*: Assembler messages:
+[^:]*:1: Error: invalid co-processor operand -- `ldc p0,c0,=.'
diff --git a/gas/testsuite/gas/arm/pr18256.s b/gas/testsuite/gas/arm/pr18256.s
new file mode 100644 (file)
index 0000000..3008d53
--- /dev/null
@@ -0,0 +1 @@
+   LDC p0, c0, =.