aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Frontend/Directive
diff options
context:
space:
mode:
authorZiqing Luo <ziqing_luo@apple.com>2026-02-03 13:23:02 -0800
committerGitHub <noreply@github.com>2026-02-03 13:23:02 -0800
commita6c926b0cf6bde1f46146e66cf17b72b62597818 (patch)
treeae1812ddf310a0d548a9f3fe860f2a25f2a784ce /llvm/lib/Frontend/Directive
parent4b4c32ce09e4a7d993607c40056a4805564188c4 (diff)
downloadllvm-main.zip
llvm-main.tar.gz
llvm-main.tar.bz2
[Thread Safety Analysis] Fix a bug of context saving in alias-analysis (#178825)HEADmain
The commit b4c98fcbe1504841203e610c351a3227f36c92a4 introduces alias-analysis and conservatively invalidates variable definitions at function calls. For each invalidated argument, it creates and pushes a context. So if there are multiple arguments being invalidated, there are more than one context being pushed. However, the analysis expects one context at the program point of a call, causing context mismatch. This issue could lead to false negatives. For example, ``` MyLock->Lock(); // 'MyLock' holds the lock Lock_t *Ptr = MyLock; // 'Ptr' aliases with 'MyLock' // Before the fix, two contexts are saved and pushed at the call below, causing context mismatch later. escapeAliasMultiple(&Irrelevant, &Ptr); Ptr->Unlock(); // 'Ptr' may no longer hold the lock but the analyzer missed it due to context mismatch ``` This commit fixes the issue. --------- Co-authored-by: Marco Elver <me@marcoelver.com>
Diffstat (limited to 'llvm/lib/Frontend/Directive')
0 files changed, 0 insertions, 0 deletions