[LLVMbugs] [Bug 7197] New: Dereference of undefined pointer value false positive

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sat May 22 07:05:50 PDT 2010


           Summary: Dereference of undefined pointer value false positive
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Static Analyzer
        AssignedTo: kremenek at apple.com
        ReportedBy: alexei.svitkine at gmail.com
                CC: llvmbugs at cs.uiuc.edu

Created an attachment (id=4924)
 --> (http://llvm.org/bugs/attachment.cgi?id=4924)
test case.

See attached file.

The pointer can never be undefined because i == MAX_FOO will evaluate to true
and the second part of the if statement will not be executed due to short
circuit evaluation.

But the analyzer makes a mistake in thinking there's a problem here:

test.c:26:34: warning: Dereference of undefined pointer value
                                if (i == MAX_FOO || foo_ptr->bar == 123)

Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

More information about the llvm-bugs mailing list