[LLVMbugs] [Bug 10462] New: JumpScopeChecker crash on invalid

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sun Jul 24 12:12:37 PDT 2011


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

           Summary: JumpScopeChecker crash on invalid
           Product: clang
           Version: unspecified
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: clattner at apple.com
                CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com


Clang crashes on:

$ cat foo.cpp
enum MyEnum {
  something_valid,
  something_invalid
};

bool recurse() {
  MyEnum K;
  switch (K) {
  case something_valid:
  case what_am_i_thinking:
    int *X = 0;
    if (recurse()) {
    }

    break;
  }
}

$ clang foo.cpp -w
x.cpp:11:8: error: use of undeclared identifier 'what_am_i_thinking'
  case what_am_i_thinking:
       ^
Assertion failed: (LabelAndGotoScopes.count(SC) && "Case not visited?"),
function VerifyJumps, file JumpDiagnostics.cpp, line 494.
0  clang             0x0000000101f7b0d5 PrintStackTrace(void*) + 53
1  clang             0x0000000101f7b78b SignalHandler(int) + 379
2  libSystem.B.dylib 0x00007fff86fba1ba _sigtramp + 26
3  libSystem.B.dylib 0x000100010044075c _sigtramp + 2034787772
4  clang             0x0000000101f7b45b raise + 27
5  clang             0x0000000101f7b51a abort + 26
6  clang             0x0000000101f7b4f4 __assert_rtn + 132
7  clang             0x0000000100429b6c (anonymous
namespace)::JumpScopeChecker::VerifyJumps() + 492
8  clang             0x00000001004289e7 (anonymous
namespace)::JumpScopeChecker::JumpScopeChecker(clang::Stmt*, clang::Sema&) +
263
9  clang             0x0000000100428715 (anonymous
namespace)::JumpScopeChecker::JumpScopeChecker(clang::Stmt*, clang::Sema&) + 37
10 clang             0x00000001004286d1
clang::Sema::DiagnoseInvalidJumps(clang::Stmt*) + 49
...

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