Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JumpScopeChecker crash on invalid #10834

Closed
lattner opened this issue Jul 24, 2011 · 2 comments
Closed

JumpScopeChecker crash on invalid #10834

lattner opened this issue Jul 24, 2011 · 2 comments
Labels
bugzilla Issues migrated from bugzilla c++ crash-on-invalid

Comments

@lattner
Copy link
Collaborator

lattner commented Jul 24, 2011

Bugzilla Link 10462
Resolution FIXED
Resolved on Jul 28, 2011 20:27
Version unspecified
OS All
CC @akyrtzi,@DougGregor,@tkremenek,@rjmccall

Extended Description

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

@tkremenek
Copy link
Contributor

cloned to rdar://problem/9852007

@akyrtzi
Copy link
Contributor

akyrtzi commented Jul 29, 2011

r136447.

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 3, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla c++ crash-on-invalid
Projects
None yet
Development

No branches or pull requests

3 participants