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

            Bug ID: 19495
           Summary: Warn about out of scope tests
           Product: clang
           Version: 3.4
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Static Analyzer
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    Classification: Unclassified

The following program:

static int arr[] = { 1, 2, 3, 4 };

int lookup( int index )
{
    if( index<1 || index>4 )
        return -1;

    return arr[index];
}

Passes the static validator without a warning. This despite the off by one that
makes accessing element 0 impossible, and element 4 out of bounds.

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