-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.C-bugCategory: This is a bug.Category: This is a bug.P-mediumMedium priorityMedium priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
Some functions in rustllvm rely on llvm_unreachable
to catch errors. However, in release mode llvm_unreachable
expands to the C++ compiler's equivalent of intrinsics::unreachable()
(i.e., it's a hint to the optimizer and UB to execute). This subverts the intent of several functions, causing us to execute UB instead of crashing as intended. All uses of llvm_unreachable
in rustllvm should be audited and replaced with report_fatal_error
unless the potential-UB is intended.
kennytm and eddyb
Metadata
Metadata
Assignees
Labels
A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.C-bugCategory: This is a bug.Category: This is a bug.P-mediumMedium priorityMedium priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.