aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2019-03-18 22:34:36 +1030
committerAlan Modra <amodra@gmail.com>2019-03-18 22:39:55 +1030
commitaf60449c260235478f9b1f9db39a587fe4c75290 (patch)
tree2bd898fb2084bbe4e83cd6587f1309a85c5b4ae2
parentc6cdff46c9d35e0c811e179fc6642ed71473bc66 (diff)
downloadgdb-af60449c260235478f9b1f9db39a587fe4c75290.zip
gdb-af60449c260235478f9b1f9db39a587fe4c75290.tar.gz
gdb-af60449c260235478f9b1f9db39a587fe4c75290.tar.bz2
Use temp_ilp and restore_ilp in more places
* as.c (macro_expr): Use temp_ilp and restore_ilp. * macro.c (buffer_and_nest): Likewise. * read.c (temp_ilp): Remove FIXME.
-rw-r--r--gas/ChangeLog3
-rw-r--r--gas/as.c6
-rw-r--r--gas/macro.c5
-rw-r--r--gas/read.c5
4 files changed, 8 insertions, 11 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index dbfde1e..bbd4a9c 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,6 +1,9 @@
2019-03-18 Alan Modra <amodra@gmail.com>
* config/m68k-parse.y (yylex): Use temp_ilp and restore_ilp.
+ * as.c (macro_expr): Likewise.
+ * macro.c (buffer_and_nest): Likewise.
+ * read.c (temp_ilp): Remove FIXME.
2019-03-18 H.J. Lu <hongjiu.lu@intel.com>
diff --git a/gas/as.c b/gas/as.c
index 728811b..c7bdf0c 100644
--- a/gas/as.c
+++ b/gas/as.c
@@ -1102,16 +1102,14 @@ close_output_file (void)
static size_t
macro_expr (const char *emsg, size_t idx, sb *in, offsetT *val)
{
- char *hold;
expressionS ex;
sb_terminate (in);
- hold = input_line_pointer;
- input_line_pointer = in->ptr + idx;
+ temp_ilp (in->ptr + idx);
expression_and_evaluate (&ex);
idx = input_line_pointer - in->ptr;
- input_line_pointer = hold;
+ restore_ilp ();
if (ex.X_op != O_constant)
as_bad ("%s", emsg);
diff --git a/gas/macro.c b/gas/macro.c
index 5f41c13..b79d922 100644
--- a/gas/macro.c
+++ b/gas/macro.c
@@ -223,14 +223,13 @@ buffer_and_nest (const char *from, const char *to, sb *ptr,
anyway, there's not an obviously better fix here. */
if (strncasecmp (ptr->ptr + i, "linefile", 8) == 0)
{
- char *saved_input_line_pointer = input_line_pointer;
char saved_eol_char = ptr->ptr[ptr->len];
ptr->ptr[ptr->len] = '\0';
- input_line_pointer = ptr->ptr + i + 8;
+ temp_ilp (ptr->ptr + i + 8);
s_app_line (0);
+ restore_ilp ();
ptr->ptr[ptr->len] = saved_eol_char;
- input_line_pointer = saved_input_line_pointer;
ptr->len = line_start;
}
}
diff --git a/gas/read.c b/gas/read.c
index 228fe7a..ac0048d 100644
--- a/gas/read.c
+++ b/gas/read.c
@@ -6213,10 +6213,7 @@ static char *saved_limit;
overruns should not occur. Saves the current input line pointer so that
it can be restored by calling restore_ilp().
- Does not support recursion.
-
- FIXME: This function is currently only used by stabs.c but that
- should be extended to other files in the gas source directory. */
+ Does not support recursion. */
void
temp_ilp (char *buf)