-
Notifications
You must be signed in to change notification settings - Fork 12.1k
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
Clang 18.1.0-rc / trunk crash when generating code with coverage information - `detail::isPresent(Val) && "dyn_cast on a non-existent value"' failed #79957
Labels
Comments
github-actions
bot
added
the
clang
Clang issues not falling into any other category
label
Jan 30, 2024
EugeneZelenko
added
clang:codegen
coverage
crash
Prefer [crash-on-valid] or [crash-on-invalid]
and removed
clang
Clang issues not falling into any other category
labels
Jan 30, 2024
@llvm/issue-subscribers-clang-codegen Author: Jeremiah Rodriguez (jeremiahar)
The following code crashes clang when compiled with code coverage enabled:
typedef void (*FunctionType)();
template <FunctionType table[]>
void Dispatch()
{
table[1]();
}
void Handler()
{
}
FunctionType Funcs[2] = {
&Dispatch<Funcs>,
&Handler
};
void Foo()
{
Funcs[0]();
} Compiled with:
Clang 18.1.0 version:
Backtrace from clang 18.1.0:
Clang trunk (assertions enabled) Godbolt link: Backtrace from clang trunk:
The test case is reduced from Highway's dispatch code https://github.com/google/highway/blob/cc0a171fb9bf8af5e8904b77259ce4ca5461172b/hwy/highway.h#L379 . |
bolshakov-a
added a commit
to bolshakov-a/llvm-project
that referenced
this issue
Mar 20, 2024
Introduced in llvm#78041, originally reported as llvm#79957 and fixed partially in llvm#80050. `OpaqueValueExpr` used with `TemplateArgument::StructuralValue` has no corresponding source expression. A test case with subobject-referring NTTP added.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The following code crashes clang when compiled with code coverage enabled:
Compiled with:
Clang 18.1.0 version:
Backtrace from clang 18.1.0:
Clang trunk (assertions enabled) Godbolt link:
https://godbolt.org/z/8T5GqcfTs
Backtrace from clang trunk:
The test case is reduced from Highway's dispatch code https://github.com/google/highway/blob/cc0a171fb9bf8af5e8904b77259ce4ca5461172b/hwy/highway.h#L379 .
The text was updated successfully, but these errors were encountered: