rustllvm: Use report_fatal_error instead of llvm_unreachable #44020
Labels
A-LLVM
Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.
C-bug
Category: This is a bug.
P-medium
Medium priority
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Uh oh!
There was an error while loading. Please reload this page.
Some functions in rustllvm rely on
llvm_unreachable
to catch errors. However, in release modellvm_unreachable
expands to the C++ compiler's equivalent ofintrinsics::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 ofllvm_unreachable
in rustllvm should be audited and replaced withreport_fatal_error
unless the potential-UB is intended.The text was updated successfully, but these errors were encountered: