aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@codesourcery.com>2010-05-05 14:17:50 +0000
committerNathan Sidwell <nathan@codesourcery.com>2010-05-05 14:17:50 +0000
commit847d4311801b81716f9670f25ae97aace2740519 (patch)
tree9c2fe895c155cd4ec40423ce04f6f808de1ddd5b
parent1412f70bc66429290d396f9b0d19ac0851c019b5 (diff)
downloadgdb-847d4311801b81716f9670f25ae97aace2740519.zip
gdb-847d4311801b81716f9670f25ae97aace2740519.tar.gz
gdb-847d4311801b81716f9670f25ae97aace2740519.tar.bz2
* read.c (cons_worker): Detect and reject unexpected string argument.
testsuite/ * gas/all/byte.s: New. * gas/all/byte.l: New. * gas/all/byte.d: New. * gas/all/gas.exp: Add it.
-rw-r--r--gas/ChangeLog4
-rw-r--r--gas/read.c10
-rw-r--r--gas/testsuite/ChangeLog7
-rw-r--r--gas/testsuite/gas/all/byte.d2
-rw-r--r--gas/testsuite/gas/all/byte.l3
-rw-r--r--gas/testsuite/gas/all/byte.s2
-rw-r--r--gas/testsuite/gas/all/gas.exp2
7 files changed, 29 insertions, 1 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index d8bfcd0..e8aefbf 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,7 @@
+2010-05-05 Julian Brown <julian@codesourcery.com>
+
+ * read.c (cons_worker): Detect and reject unexpected string argument.
+
2010-05-04 Nick Clifton <nickc@redhat.com>
* write.c (fixup_segment): Revert previous delta.
diff --git a/gas/read.c b/gas/read.c
index 4afb190..32ac5e2 100644
--- a/gas/read.c
+++ b/gas/read.c
@@ -3865,7 +3865,15 @@ cons_worker (int nbytes, /* 1=.byte, 2=.word, 4=.long. */
parse_mri_cons (&exp, (unsigned int) nbytes);
else
#endif
- TC_PARSE_CONS_EXPRESSION (&exp, (unsigned int) nbytes);
+ {
+ if (*input_line_pointer == '"')
+ {
+ as_bad (_("unexpected `\"' in expression"));
+ ignore_rest_of_line ();
+ return;
+ }
+ TC_PARSE_CONS_EXPRESSION (&exp, (unsigned int) nbytes);
+ }
if (rva)
{
diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog
index c9eae54..bed67b5 100644
--- a/gas/testsuite/ChangeLog
+++ b/gas/testsuite/ChangeLog
@@ -1,3 +1,10 @@
+2010-05-05 Nathan Sidwell <nathan@codesourcery.com>
+
+ * gas/all/byte.s: New.
+ * gas/all/byte.l: New.
+ * gas/all/byte.d: New.
+ * gas/all/gas.exp: Add it.
+
2010-04-29 Nathan Sidwell <nathan@codesourcery.com>
* gas/arm/weakdef-1.s: New.
diff --git a/gas/testsuite/gas/all/byte.d b/gas/testsuite/gas/all/byte.d
new file mode 100644
index 0000000..739b9ce
--- /dev/null
+++ b/gas/testsuite/gas/all/byte.d
@@ -0,0 +1,2 @@
+#name: bad byte directive
+#error-output: byte.l
diff --git a/gas/testsuite/gas/all/byte.l b/gas/testsuite/gas/all/byte.l
new file mode 100644
index 0000000..a87bb71
--- /dev/null
+++ b/gas/testsuite/gas/all/byte.l
@@ -0,0 +1,3 @@
+[^:]*: Assembler messages:
+[^:]*:1: Error: unexpected `"' in expression
+[^:]*:2: Error: unexpected `"' in expression
diff --git a/gas/testsuite/gas/all/byte.s b/gas/testsuite/gas/all/byte.s
new file mode 100644
index 0000000..8d60938
--- /dev/null
+++ b/gas/testsuite/gas/all/byte.s
@@ -0,0 +1,2 @@
+ .byte " "
+ .byte " "
diff --git a/gas/testsuite/gas/all/gas.exp b/gas/testsuite/gas/all/gas.exp
index 8008236..8e0483e 100644
--- a/gas/testsuite/gas/all/gas.exp
+++ b/gas/testsuite/gas/all/gas.exp
@@ -329,6 +329,8 @@ if { ![istarget "tic4x*-*-*"] && ![istarget "tic54x*-*-*"] && ![istarget "hppa*-
run_dump_test relax
}
+run_dump_test byte
+
# .quad is 16 bytes on i960.
if { ![istarget "i960-*-*"] } {
run_dump_test quad