This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Commit: Add support for a temporary input line pointer in gas/read.c


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]