aboutsummaryrefslogtreecommitdiff
path: root/gas/read.c
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1995-09-07 21:54:13 +0000
committerIan Lance Taylor <ian@airs.com>1995-09-07 21:54:13 +0000
commit3dce804d95038e79221db090a067112bbca304d1 (patch)
tree2f53c46c55df2707cc1d25d7deb95062cd44ad84 /gas/read.c
parent535c89f0a55960aa14bcd842c20a3727b3235e8b (diff)
downloadgdb-3dce804d95038e79221db090a067112bbca304d1.zip
gdb-3dce804d95038e79221db090a067112bbca304d1.tar.gz
gdb-3dce804d95038e79221db090a067112bbca304d1.tar.bz2
* expr.c (operand): Handle 08 and 09 in MRI mode.
* macro.c (ISSEP): Remove duplicated `"' character. (get_any_string): Copy some characters for which ISSEP is true: ';', '>', '(', ')'. Otherwise we can get in an infinite loop. * read.c (s_space): In MRI mode, the expressions stop at the first unquoted space. (cons_worker): In MRI mode, restore the terminating character at the end of the function.
Diffstat (limited to 'gas/read.c')
-rw-r--r--gas/read.c44
1 files changed, 38 insertions, 6 deletions
diff --git a/gas/read.c b/gas/read.c
index 3b313eb..f7a4f55 100644
--- a/gas/read.c
+++ b/gas/read.c
@@ -2030,11 +2030,32 @@ s_space (mult)
expressionS exp;
long temp_fill;
char *p = 0;
+ char *stop = NULL;
+ char stopc;
#ifdef md_flush_pending_output
md_flush_pending_output ();
#endif
+ /* In MRI mode, the operands end at the first unquoted space. */
+ if (flag_mri)
+ {
+ char *s;
+ int inquote = 0;
+
+ for (s = input_line_pointer;
+ ((! is_end_of_line[(unsigned char) *s] && *s != ' ' && *s != '\t')
+ || inquote);
+ s++)
+ {
+ if (*s == '\'')
+ inquote = ! inquote;
+ }
+ stop = s;
+ stopc = *stop;
+ *stop = '\0';
+ }
+
/* Just like .fill, but temp_size = 1 */
expression (&exp);
if (exp.X_op == O_constant)
@@ -2049,16 +2070,14 @@ s_space (mult)
if (! flag_mri || repeat < 0)
as_warn (".space repeat count is %s, ignored",
repeat ? "negative" : "zero");
- ignore_rest_of_line ();
- return;
+ goto getout;
}
/* If we are in the absolute section, just bump the offset. */
if (now_seg == absolute_section)
{
abs_section_offset += repeat;
- demand_empty_rest_of_line ();
- return;
+ goto getout;
}
/* If we are secretly in an MRI common section, then creating
@@ -2067,8 +2086,7 @@ s_space (mult)
{
S_SET_VALUE (mri_common_symbol,
S_GET_VALUE (mri_common_symbol) + repeat);
- demand_empty_rest_of_line ();
- return;
+ goto getout;
}
if (!need_pass_2)
@@ -2105,6 +2123,16 @@ s_space (mult)
{
*p = temp_fill;
}
+
+ getout:
+ if (flag_mri)
+ {
+ input_line_pointer = stop;
+ *stop = stopc;
+ while (! is_end_of_line[(unsigned char) *input_line_pointer])
+ ++input_line_pointer;
+ }
+
demand_empty_rest_of_line ();
}
@@ -2394,6 +2422,7 @@ cons_worker (nbytes, rva)
int c;
expressionS exp;
char *stop = NULL;
+ char stopc;
#ifdef md_flush_pending_output
md_flush_pending_output ();
@@ -2420,6 +2449,8 @@ cons_worker (nbytes, rva)
inquote = ! inquote;
}
stop = s;
+ stopc = *stop;
+ *stop = '\0';
}
c = 0;
@@ -2467,6 +2498,7 @@ cons_worker (nbytes, rva)
if (flag_mri)
{
input_line_pointer = stop;
+ *stop = stopc;
while (! is_end_of_line[(unsigned char) *input_line_pointer])
++input_line_pointer;
}