[PATCH] Clean reg class and base_reg for input output operand (%dx).
Jan Beulich
jbeulich@suse.com
Thu Dec 7 08:51:27 GMT 2023
On 07.12.2023 09:48, Cui, Lili wrote:
>> On 06.12.2023 14:12, Cui, Lili wrote:
>>> --- a/gas/config/tc-i386.c
>>> +++ b/gas/config/tc-i386.c
>>> @@ -13016,6 +13016,8 @@ i386_att_operand (char *operand_string)
>>> && !operand_type_check (i.types[this_operand], disp))
>>> {
>>> i.types[this_operand] = i.base_reg->reg_type;
>>> + i.types[this_operand].bitfield.class = 0;
>>> + i.base_reg = NULL;
>>
>> I agree with the latter, but I don't understand the former. The more that in
>> earlier discussion on the APX subthread I clearly indicated what I think needs
>> doing here.
>>
>
> The original issue was that we encountered a segment fault when accessing i.op[op].regs->reg_flags, and since the input was (%dx), we treat it as memory, so I think we need to clean up i.types[this_operand]. bitfield.class = 0 and leave i.base_reg there, it means i.base_reg does not need to be cleaned.
As said before - what is missing as far as I understand it is the updating
of i.op[].regs in the code above. That ought to be (much) preferred over
invalidating .class (and thus perhaps causing new latent issues).
Jan
More information about the Binutils
mailing list