llvm-project
0764f65a - [clang] Fix nondeterminism in MemberPointerType (#137910)

Commit
149 days ago
[clang] Fix nondeterminism in MemberPointerType (#137910) This commit fixes the nondeterminism issue in C++ header module enabled builds which were observed after https://github.com/llvm/llvm-project/pull/132401. The issue was related to the fact that the hash set operation in MemberPointerType::Profile() was triggering getMostRecentDecl(). As the latter may trigger the loading of new entities from the external AST source, this was presumably causing reentrant modification of data structure or some other issue that affects compiler's output in a nondeterministic way (likely depending on specific values hashes/pointers have). The change should otherwise be a no-op, because whether we take a "most recent" or "any" Decl shouldn't matter since `getCanonicalDecl()` is called on it anyway inside `MemberPointerType::Profile()`. We haven't been able to come up with a deterministic regression test for this fix.
Author
Parents
Loading