[llvm-bugs] [Bug 51928] New: Thread safety analysis: False positive of on exclusive_trylock_function in boolean expression

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Sep 21 09:53:25 PDT 2021


https://bugs.llvm.org/show_bug.cgi?id=51928

            Bug ID: 51928
           Summary: Thread safety analysis: False positive of on
                    exclusive_trylock_function in boolean expression
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Static Analyzer
          Assignee: dcoughlin at apple.com
          Reporter: dino.radakovich at gmail.com
                CC: dcoughlin at apple.com, llvm-bugs at lists.llvm.org

Example: https://godbolt.org/z/q45aMxMnE

Using an `exclusive_trylock_function` in a boolean expression causes
-Wthread-safety-analysis to warn that the lock "is not held on every path
through here".

This seems like either a false positive or false negative.
I thought it was the former, as I found it in an expression similar to
`m.TryLock() || Exit()`, where `Exit()` is a noreturn function that calls
`exit()`.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20210921/98e5cc3e/attachment.html>


More information about the llvm-bugs mailing list