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

             Bug #: 14797
           Summary: Analyzer gets confused by decrementing loops
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Static Analyzer
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected]
    Classification: Unclassified


Apparently the analyzers data flow analysis apparently gets confused by loops
which count downwards. Below is a small testcase, which works fine when the
first loop is changed to increment. As is the static analyzer claims
uninitialized values in the second loop;

#include <assert.h>
void foo(int len)
{
    int a[5], b;

    assert((len > 0) && (len <= 5));

    for (int i = len-1; i >= 0; i--)
        a[i] = 0;

    for (int i = len-1; i >= 0; i--)
        b = a[i];
}

-- 
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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to