Skip to content

clang codegen crash with address-of-label in illegal locations #8396

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

Closed
efriedma-quic opened this issue Aug 29, 2010 · 1 comment
Closed
Labels
bugzilla Issues migrated from bugzilla clang:frontend Language frontend issues, e.g. anything involving "Sema" crash-on-invalid worksforme Resolved as "works for me"

Comments

@efriedma-quic
Copy link
Collaborator

Bugzilla Link 8024
Resolution WORKSFORME
Resolved on Mar 28, 2011 18:28
Version unspecified
OS Linux

Extended Description

Testcase 1:
void* a = &&N;

Crashes with:
clang: CGExprConstant.cpp:787: llvm::Constant*::ConstExprEmitter::EmitLValue(clang::Expr*): Assertion `CGF && "Invalid address of label expression outside function."' failed.

Testcase 2 (C++):
int f(void* = &&N);
void g() { f(); }

Crashes with:
Referring to a basic block in another function!
indirectbr i8* undef, [label %N]
Broken module found, compilation aborted!

These constructs should get rejected before codegen.

@efriedma-quic
Copy link
Collaborator Author

This got fixed at some point.

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 3, 2021
@Quuxplusone Quuxplusone added the worksforme Resolved as "works for me" label Jan 20, 2022
augusto2112 pushed a commit to augusto2112/llvm-project that referenced this issue Mar 18, 2024
Revert "[Clang] Don't use crtbegin/crtend when building for musl."
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 clang:frontend Language frontend issues, e.g. anything involving "Sema" crash-on-invalid worksforme Resolved as "works for me"
Projects
None yet
Development

No branches or pull requests

2 participants