<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/113325>113325</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[clang] clang trunk crashes at (anonymous namespace)::JumpScopeChecker::DiagnoseIndirectOrAsmJump(clang::Stmt*, unsigned int, clang::LabelDecl*, unsigned int)
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang:frontend,
crash-on-invalid,
clang:frontend:fuzzer,
regression:17
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
yijan4845
</td>
</tr>
</table>
<pre>
**This testcase is generated by a fuzzer.**
Compiler explorer: [https://godbolt.org/z/jT55687eW](https://godbolt.org/z/jT55687eW)
This invalid code will crash on both Clang Trunk and Clang Assertion Trunk:
```cpp
void func() {
try { } catch(...) {
__label__ label;
asm goto("" : : : : label);
};
}
```
It seems that this goes back to clang-17.
Stack dump:
```
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0. Program arguments: /opt/compiler-explorer/clang-assertions-trunk/bin/clang++ -gdwarf-4 -g -o /app/output.s -mllvm --x86-asm-syntax=intel -fno-verbose-asm -S --gcc-toolchain=/opt/compiler-explorer/gcc-snapshot -fcolor-diagnostics -fno-crash-diagnostics <source>
1. <eof> parser at end of file
2. <source>:1:13: parsing function body 'func'
#0 0x0000000003bc6148 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x3bc6148)
#1 0x0000000003bc3e0c llvm::sys::CleanupOnSignal(unsigned long) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x3bc3e0c)
#2 0x0000000003b114b8 CrashRecoverySignalHandler(int) CrashRecoveryContext.cpp:0:0
#3 0x000072041a842520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
#4 0x00000000075a213b DiagnoseIndirectOrAsmJumpStmt(clang::Sema&, clang::Stmt*, clang::LabelDecl*, bool&) (.part.0) JumpDiagnostics.cpp:0:0
#5 0x00000000075a6541 (anonymous namespace)::JumpScopeChecker::DiagnoseIndirectOrAsmJump(clang::Stmt*, unsigned int, clang::LabelDecl*, unsigned int) JumpDiagnostics.cpp:0:0
#6 0x00000000075a6b60 (anonymous namespace)::JumpScopeChecker::VerifyJumps() JumpDiagnostics.cpp:0:0
#7 0x00000000075ae8aa clang::Sema::DiagnoseInvalidJumps(clang::Stmt*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x75ae8aa)
#8 0x0000000006a444e2 clang::Sema::ActOnFinishFunctionBody(clang::Decl*, clang::Stmt*, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6a444e2)
#9 0x00000000067856cf clang::Parser::ParseFunctionStatementBody(clang::Decl*, clang::Parser::ParseScope&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x67856cf)
#10 0x0000000006699223 clang::Parser::ParseFunctionDefinition(clang::ParsingDeclarator&, clang::Parser::ParsedTemplateInfo const&, clang::Parser::LateParsedAttrList*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6699223)
#11 0x00000000066cd8dd clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&, clang::DeclaratorContext, clang::ParsedAttributes&, clang::Parser::ParsedTemplateInfo&, clang::SourceLocation*, clang::Parser::ForRangeInit*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x66cd8dd)
#12 0x000000000668cf6e clang::Parser::ParseDeclOrFunctionDefInternal(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec&, clang::AccessSpecifier) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x668cf6e)
#13 0x000000000668d72e clang::Parser::ParseDeclarationOrFunctionDefinition(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*, clang::AccessSpecifier) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x668d72e)
#14 0x0000000006694ec3 clang::Parser::ParseExternalDeclaration(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6694ec3)
#15 0x0000000006695dad clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, clang::Sema::ModuleImportState&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6695dad)
#16 0x0000000006696250 clang::Parser::ParseFirstTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, clang::Sema::ModuleImportState&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6696250)
#17 0x0000000006688292 clang::ParseAST(clang::Sema&, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6688292)
#18 0x000000000453b728 clang::CodeGenAction::ExecuteAction() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x453b728)
#19 0x00000000047f6bf9 clang::FrontendAction::Execute() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x47f6bf9)
#20 0x00000000047756be clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x47756be)
#21 0x00000000048dc3de clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x48dc3de)
#22 0x0000000000cdee3f cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0xcdee3f)
#23 0x0000000000cd6b3a ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&) driver.cpp:0:0
#24 0x000000000457f449 void llvm::function_ref<void ()>::callback_fn<clang::driver::CC1Command::Execute(llvm::ArrayRef<std::optional<llvm::StringRef>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, bool*) const::'lambda'()>(long) Job.cpp:0:0
#25 0x0000000003b11964 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x3b11964)
#26 0x000000000457fa3f clang::driver::CC1Command::Execute(llvm::ArrayRef<std::optional<llvm::StringRef>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, bool*) const (.part.0) Job.cpp:0:0
#27 0x000000000454533d clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x454533d)
#28 0x000000000454642d clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&, bool) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x454642d)
#29 0x000000000454dd55 clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x454dd55)
#30 0x0000000000cdbcff clang_main(int, char**, llvm::ToolContext const&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0xcdbcff)
#31 0x0000000000baadf4 main (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0xbaadf4)
#32 0x000072041a829d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#33 0x000072041a829e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#34 0x0000000000cd65ee _start (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0xcd65ee)
clang++: error: clang frontend command failed with exit code 139 (use -v to see invocation)
Compiler returned: 139
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzkWl1v2zgW_TXMCyFDor4f8uDY9WyKLFo0weyjQVGUzalEakkqdfrrFyTlRFQctx3ExWJ3MG5sfp5z7uXlFUWsFNtxSq9BegPS9RUe9F7I6yf2F-ZJkaRXlaifrgFaArR82DMFNVWaYE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