[PATCH] gas: correct .irpc handling with empty string

Jan Beulich jbeulich@suse.com
Wed Aug 14 13:34:10 GMT 2024


On 14.08.2024 15:30, Bernhard Übelacker wrote:
> Am 12.08.24 um 16:50 schrieb Jan Beulich:
>> Following 69cab370cf66 ("gas: adjust handling of quotes for .irpc") the
>> closing quote was mistakenly treated as the first quoted character.
>> ---
>> I recall wondering about the lack of "continue" there. Yet I wrongly
>> concluded that since there was none, there also shouldn't be any.
>>
>> --- a/gas/macro.c
>> +++ b/gas/macro.c
>> @@ -1389,6 +1389,7 @@ expand_irp (int irpc, size_t idx, sb *in
>>   		      if (idx >= in->len)
>>   			break;
>>   		    }
>> +		  continue;
>>   		}
>>   	      sb_reset (&f.actual);
>>   	      sb_add_char (&f.actual, in->ptr[idx]);
>> --- a/gas/testsuite/gas/macros/irpc-quote.s
>> +++ b/gas/testsuite/gas/macros/irpc-quote.s
>> @@ -1,6 +1,6 @@
>> -	.irpc c, " ab" cd " ef"
>> +	.irpc c, " ab" cd " ef" ""
>>   	.print ">\c<"
>>   	.endr
>> -	.irpc c, "12 " 34 "56 "
>> +	.irpc c, "" "12 " 34 "56 "
>>   	.print ">\c<"
>>   	.endr
> 
> Hello Jan,
> I am not sure if this patch should handle the issue in the Debian bug completely.
> 
> At least I tested current git with your patch applied, but the issue seems still visible.

I'm surprised, because I actually tried with the full example you pointed at,
and the resulting .o was the same again as it was with 2.42. I'll double-check
though ...

Jan


More information about the Binutils mailing list