[PATCH 05/34] Arm: use is_end_of_stmt()

Nick Clifton nickc@redhat.com
Thu Feb 20 09:14:04 GMT 2025


Hi Jan,

> ... instead of open-coding it. This also fixes an array underrun issue:
> The wrong casting to plain int could have yielded negative values when
> plain char is a signed type.
> 
> --- a/gas/config/tc-arm.c
> +++ b/gas/config/tc-arm.c
> @@ -3668,7 +3668,7 @@ tc_start_label_without_colon (void)
>       {
>         const char *label = input_line_pointer;
>   
> -      while (!is_end_of_line[(int) label[-1]])
> +      while (!is_end_of_stmt (label[-1]))
 >   	--label;

Sure that makes sense to be.  I am worries about this potentially
unbounded backwards scan, but I cannot think of a reasonable way
of preventing it short of reworking the whole input_line_pointer
mechanism.

Cheers
   Nick





More information about the Binutils mailing list