[LLVMbugs] [Bug 15527] New: Feature request: warn on possibly-infinite loops without sequence points

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Mar 15 15:11:27 PDT 2013


http://llvm.org/bugs/show_bug.cgi?id=15527

            Bug ID: 15527
           Summary: Feature request: warn on possibly-infinite loops
                    without sequence points
           Product: clang
           Version: trunk
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Static Analyzer
          Assignee: kremenek at apple.com
          Reporter: juli at clockworksquid.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

It is common in threaded code to see things like "while (foo->bar) continue;"
where bar is a field of the struct pointed to by foo which is expected to be
changed in another thread (or on signal, or ...)  Usually, correct
implementations would have an unlock and a relock (or ideally a block on a
condition variable), thus putting a sequence point within the loop and
requiring the compiler to reload the value of foo->bar over and over again, or
bar or foo may be declared volatile, however occasionally implementations that
are so simplistic do occur.

I would like to see the static analyzer detect these conditions, namely by
detecting that a loop conditional will only be checked once, and then will
either proceed or will reliably enter into an infinite loop.

-- 
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/20130315/a466d59d/attachment.html>


More information about the llvm-bugs mailing list