Closed
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.