[clang] [analyzer] Model XNU try-lock nonzero return as success (PR #248014)

via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 2 02:32:13 PST 2026


llvmorg-github-actions[bot] wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang

Author: Endre Fülöp (gamesh411)

<details>
<summary>Changes</summary>

XNU try-lock functions signal success by returning a nonzero value, which is the opposite of how the pthread library does it. The implementation of alpha.unix.PthreadLock mistakenly assumed the pthread semantics. This was introduced as a regression in 152bc7ffdcd8 while migrating the logic to use a CallDescriptionMap.

Fixes #<!-- -->246175

Assisted-by: Claude Code

---
Full diff: https://github.com/llvm/llvm-project/pull/248014.diff


3 Files Affected:

- (modified) clang/docs/ReleaseNotes.md (+5) 
- (modified) clang/lib/StaticAnalyzer/Checkers/PthreadLockChecker.cpp (+1-1) 
- (modified) clang/test/Analysis/pthreadlock.c (+10) 


``````````diff
The server is unavailable at this time. Please wait a few minutes before you try again.
``````````

</details>


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


More information about the cfe-commits mailing list