Skip to content

Commit

Permalink
Avoid ICE on transmuting invalid bools
Browse files Browse the repository at this point in the history
Fixes #1433
  • Loading branch information
bjorn3 committed May 11, 2024
1 parent 906db02 commit 9e4e805
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions src/value_and_place.rs
Original file line number Diff line number Diff line change
Expand Up @@ -317,14 +317,6 @@ impl<'tcx> CValue<'tcx> {

let clif_ty = fx.clif_type(layout.ty).unwrap();

if let ty::Bool = layout.ty.kind() {
assert!(
const_val == ty::ScalarInt::FALSE || const_val == ty::ScalarInt::TRUE,
"Invalid bool 0x{:032X}",
const_val
);
}

let val = match layout.ty.kind() {
ty::Uint(UintTy::U128) | ty::Int(IntTy::I128) => {
let const_val = const_val.assert_bits(layout.size);
Expand Down

0 comments on commit 9e4e805

Please sign in to comment.