lck_mtx_lock() returns void. The analyzer failed to model its effect because he was surprised that the return value is Unknown. Prepare for the aforementioned surprise and fix the tests accordingly.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
lib/StaticAnalyzer/Checkers/PthreadLockChecker.cpp | ||
---|---|---|
271 ↗ | (On Diff #115029) | Because it is relevant in both places. Should i rephrase with "also"/"as well"/"here too"? |
test/Analysis/Inputs/system-header-simulator-for-pthread-lock.h | ||
29 ↗ | (On Diff #115029) | The tests are already there for all three functions. I just fixed their prototype to match the real-world prototype, and then adjusted the code accordingly, so that the existing tests kept passing. |
Comment Actions
Hi Artem,
Sorry for long delay for reviews. Unfortunately, hospital is a bad place to do a code review and broken hand is a bad review assistant. This patch looks good to me, I have just a minor comment nit.
lib/StaticAnalyzer/Checkers/PthreadLockChecker.cpp | ||
---|---|---|
282 ↗ | (On Diff #115029) | TODO? |
Comment Actions
Hey wb! Get well :)
lib/StaticAnalyzer/Checkers/PthreadLockChecker.cpp | ||
---|---|---|
282 ↗ | (On Diff #115029) | That'd make a terrible project of choice for people grepping for TODOs and FIXMEs, so I guess rather not. |
Comment Actions
Looks good to me.
lib/StaticAnalyzer/Checkers/PthreadLockChecker.cpp | ||
---|---|---|
271 ↗ | (On Diff #115029) | Small rephrasing will be good because it will clearly state that it is not a copy-paste error :) |