[LLVMbugs] [Bug 14091] New: Version: xcode 4.5.1 release -- dead code in switch before first case not flagged.

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Oct 15 13:43:47 PDT 2012


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

             Bug #: 14091
           Summary: Version: xcode 4.5.1 release -- dead code in switch
                    before first case not flagged.
           Product: clang
           Version: 3.1
          Platform: Macintosh
        OS/Version: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: Static Analyzer
        AssignedTo: kremenek at apple.com
        ReportedBy: kirkkerekes at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


Code in switch block before first case is "dead", but not flagged by analyzer.

Example:

switch(1)
    {

    int x = 3; // variable will not be initialized
    NSLog(@"code Executed"); // code will not be executed

        case 1:
             NSLog(@"case:");
        break;
    }

-- result is "case:" because code inside switch block before first case is not
executed. 

Analyzer does correctly notice if a variable at the top of the switch is used
uninitialized.

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