aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2015-04-29 17:09:05 +0100
committerNick Clifton <nickc@redhat.com>2015-04-29 17:09:05 +0100
commit99b2a2dd3cd91ee45aba56a90b52be943001e8f4 (patch)
tree3a41845febc92c317694a0232466a17a995d07a8 /gas
parent43c1d34c319626747c6765253294eb458a7bd93d (diff)
downloadbinutils-99b2a2dd3cd91ee45aba56a90b52be943001e8f4.zip
binutils-99b2a2dd3cd91ee45aba56a90b52be943001e8f4.tar.gz
binutils-99b2a2dd3cd91ee45aba56a90b52be943001e8f4.tar.bz2
Fix an internal error in GAS when assembling a bogus piece of source code.
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.
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog6
-rw-r--r--gas/config/tc-arm.c7
-rw-r--r--gas/testsuite/ChangeLog7
-rw-r--r--gas/testsuite/gas/arm/pr18256.d9
-rw-r--r--gas/testsuite/gas/arm/pr18256.l2
-rw-r--r--gas/testsuite/gas/arm/pr18256.s1
6 files changed, 31 insertions, 1 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 1affd22..9ba6648 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,5 +1,11 @@
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
times if the expression is not constant and the target uses linker
relaxation.
diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c
index 5ce4da5..bc8f775 100644
--- a/gas/config/tc-arm.c
+++ b/gas/config/tc-arm.c
@@ -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;
}
diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog
index d0167be..aed518a 100644
--- a/gas/testsuite/ChangeLog
+++ b/gas/testsuite/ChangeLog
@@ -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
index 0000000..0c5e514
--- /dev/null
+++ b/gas/testsuite/gas/arm/pr18256.d
@@ -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
index 0000000..b68e914
--- /dev/null
+++ b/gas/testsuite/gas/arm/pr18256.l
@@ -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
index 0000000..3008d53
--- /dev/null
+++ b/gas/testsuite/gas/arm/pr18256.s
@@ -0,0 +1 @@
+ LDC p0, c0, =.