This is an archive of the discontinued LLVM Phabricator instance.

[ODR] Fix using uninitialized FunctionTypeBits.FastTypeQuals in FunctionNoProtoType.
AbandonedPublic

Authored by vsapsai on Jun 25 2021, 5:24 PM.

Details

Reviewers
rsmith
riccibruno
Summary

FastTypeQuals are used only by FunctionProtoType and put in
FunctionTypeBitfields in FunctionType to pack with the other bitfields.
So in ODR-hashing they should be used only for FunctionProtoType but not
for FunctionNoProtoType or for common FunctionType.

rdar://65305646

Diff Detail

Event Timeline

vsapsai created this revision.Jun 25 2021, 5:24 PM
vsapsai requested review of this revision.Jun 25 2021, 5:24 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 25 2021, 5:24 PM

Wasn't actually able to make the test fail because Memory Sanitizer isn't supported on macOS and on Linux I cannot even build clang with MSAN enabled. The test case is reduced from an actual error we've seen internally when clang complaints Handler has different definitions in different modules. That was happening because due to uninitialized FastTypeQuals ODR-hash for different modules sometimes was different. It is a spurious error and I don't see how to create a reliable test case.

Also I don't know if we should keep FastTypeQuals in FunctionTypeBitfields or move somewhere else. Looks like it is there for a reason, so I've decided not to touch that.

vsapsai abandoned this revision.Oct 25 2022, 8:31 PM

The issue is addressed in D133586.

Herald added a project: Restricted Project. · View Herald TranscriptOct 25 2022, 8:31 PM