[clang] [Thread Analysis] Fix a bug in context update in alias-analysis (PR #178952)

Marco Elver via cfe-commits cfe-commits at lists.llvm.org
Sat Jan 31 08:03:35 PST 2026


melver wrote:

> [...]
> I haven't been able to isolate a minimal reproducer yet that we can use as a test case.

Added a test that fails with this patch: https://github.com/llvm/llvm-project/pull/179049

I think the fix is just this squashed into this patch:
```
--- a/clang/lib/Analysis/ThreadSafety.cpp
+++ b/clang/lib/Analysis/ThreadSafety.cpp
@@ -2825,6 +2825,7 @@ void ThreadSafetyAnalyzer::runAnalysis(AnalysisDeclContext &AC) {
         case CFGElement::Statement: {
           CFGStmt CS = BI.castAs<CFGStmt>();
           LocksetBuilder.Visit(CS.getStmt());
+          LocksetBuilder.updateLocalVarMapCtx(nullptr);
           break;
         }
         // Ignore BaseDtor and MemberDtor for now.
```
Please double check though...

https://github.com/llvm/llvm-project/pull/178952


More information about the cfe-commits mailing list