Problem
DesignatedInitExpr::Designator::getFieldName() can return nullptr for a field designator that reaches a member through an anonymous struct or union, for example:
struct S {
union {
int a;
};
};
struct S s = { .a = 1 };
The dumper currently avoids the null dereference by serializing an empty field-name line. That prevents the crash, but the designator record no longer carries the source spelling a. Consumers such as Clava then cannot reconstruct the designated initializer from the designator data alone. Clava currently turns the empty name into ..
Expected behavior
Preserve enough information to identify the selected member, ideally the original field name and, where needed, the anonymous-member path. The current empty string should remain a crash fix only, not the final representation.
Context
This was observed while checking the post-v18.1.8_2 changes against Clava. The null-dereference fix covers the crash but leaves the serialized representation incomplete for source regeneration.
Problem
DesignatedInitExpr::Designator::getFieldName()can returnnullptrfor a field designator that reaches a member through an anonymous struct or union, for example:The dumper currently avoids the null dereference by serializing an empty field-name line. That prevents the crash, but the designator record no longer carries the source spelling
a. Consumers such as Clava then cannot reconstruct the designated initializer from the designator data alone. Clava currently turns the empty name into..Expected behavior
Preserve enough information to identify the selected member, ideally the original field name and, where needed, the anonymous-member path. The current empty string should remain a crash fix only, not the final representation.
Context
This was observed while checking the post-
v18.1.8_2changes against Clava. The null-dereference fix covers the crash but leaves the serialized representation incomplete for source regeneration.