This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Commit: Add support for a temporary input line pointer in gas/read.c
- From: Alan Modra <amodra at gmail dot com>
- To: Nick Clifton <nickc at redhat dot com>
- Cc: binutils at sourceware dot org
- Date: Fri, 13 Jan 2017 10:56:29 +1030
- Subject: Re: Commit: Add support for a temporary input line pointer in gas/read.c
- Authentication-results: sourceware.org; auth=none
- References: <8760lk9vki.fsf@redhat.com>
Hi Nick,
On Thu, Jan 12, 2017 at 02:55:41PM +0000, Nick Clifton wrote:
> +static char *saved_ilp = NULL;
> +static char *saved_limit;
Can I suggest instead that you declare a struct save_ilp, use one of
them as a local var, and pass that by reference to the save/restore
functions. They could be made inline too.
> + /* Prevent the assert in restore_ilp from triggering if
> + the input_line_pointer has not yet been initialised. */
> + if (saved_ilp == NULL)
> + saved_limit = saved_ilp = (char *) "";
Changing saved_ilp means it really isn't saved!
--
Alan Modra
Australia Development Lab, IBM