Zero sized bit-fields aren't included in the CGRecordLayout, so we shouldn't be calling EmitLValueForField for them.
rdar://60695105
Differential D76782
[CodeGenObjC] Fix a crash when attempting to copy a zero-sized bit-field in a non-trivial C struct erik.pilkington on Mar 25 2020, 10:02 AM. Authored by
Details Zero sized bit-fields aren't included in the CGRecordLayout, so we shouldn't be calling EmitLValueForField for them. rdar://60695105
Diff Detail Event TimelineComment Actions Thanks for fixing this!
Comment Actions Don't bother including zero length bit-fields in the mangling of the copy/destroy helpers. |
Can you add the same check to GenBinaryFuncName::visitVolatileTrivial to avoid encoding the zero-length bit field into the name of the copy constructor/assignment functions? It isn't necessary to generate different functions for ZeroBitfieldin the test case and the following struct: