[LLVMbugs] [Bug 2305] New: CHECKER: false positive on uninitialized warning ( path-sensitiveness)

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Sat May 10 01:49:51 PDT 2008


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

           Summary: CHECKER: false positive on uninitialized warning (path-
                    sensitiveness)
           Product: clang
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Semantic Analyzer
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: edwintorok at gmail.com
                CC: llvmbugs at cs.uiuc.edu


Created an attachment (id=1628)
 --> (http://llvm.org/bugs/attachment.cgi?id=1628)
scan-build report

Using SVN r50942:

$ ~/llvm-svn/llvm/tools/clang/utils/ccc-analyzer ytest.c -c
ytest.c
ANALYZE: ytest.c foo
ytest.c:11:3: warning: [CHECKER] Dereference of undefined value.
                sections[0]=0;
                ^~~~~~~~~~~~~
1 diagnostic generated.

int foo(int dend, int* dst)
{
        int *pehdr = 0, *sections;
        if(dend>0xf8) {
                pehdr = &dst[dend];
                while(pehdr>dst) {
                        sections = pehdr;
                }
        }
        if(pehdr) {
                sections[0]=0;
        }
        return 0;
}

If pehdr is non-NULL, then pehdr is dst + dend, dend is >0xf8 => (pehdr>dst) is
true. The checker says the loop condition is false.


-- 
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