* 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.
This commit is contained in:
Nathan Sidwell 2010-05-05 14:17:50 +00:00
parent 1412f70bc6
commit 847d431180
7 changed files with 29 additions and 1 deletions

View File

@ -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.

View File

@ -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)
{

View File

@ -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.

View File

@ -0,0 +1,2 @@
#name: bad byte directive
#error-output: byte.l

View File

@ -0,0 +1,3 @@
[^:]*: Assembler messages:
[^:]*:1: Error: unexpected `"' in expression
[^:]*:2: Error: unexpected `"' in expression

View File

@ -0,0 +1,2 @@
.byte " "
.byte " "

View File

@ -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