Skip to content

Commit

Permalink
rustup
Browse files Browse the repository at this point in the history
  • Loading branch information
RalfJung committed Nov 30, 2021
1 parent 9983e0f commit 70dd979
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 32 deletions.
2 changes: 1 addition & 1 deletion rust-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
58f9efd36de5669ab731ec7ebf565999ff17b159
1c0287830e0fb3c4007afea2819ba03766da6e9c
31 changes: 0 additions & 31 deletions src/shims/intrinsics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -550,37 +550,6 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
"atomic_umax_relaxed" =>
this.atomic_op(args, dest, AtomicOp::Max, AtomicRwOp::Relaxed)?,

// Query type information
"assert_zero_valid" | "assert_uninit_valid" => {
let &[] = check_arg_count(args)?;
let ty = instance.substs.type_at(0);
let layout = this.layout_of(ty)?;
// Abort here because the caller might not be panic safe.
if layout.abi.is_uninhabited() {
// Use this message even for the other intrinsics, as that's what codegen does
throw_machine_stop!(TerminationInfo::Abort(format!(
"aborted execution: attempted to instantiate uninhabited type `{}`",
ty
)))
}
if intrinsic_name == "assert_zero_valid"
&& !layout.might_permit_raw_init(this, /*zero:*/ true)
{
throw_machine_stop!(TerminationInfo::Abort(format!(
"aborted execution: attempted to zero-initialize type `{}`, which is invalid",
ty
)))
}
if intrinsic_name == "assert_uninit_valid"
&& !layout.might_permit_raw_init(this, /*zero:*/ false)
{
throw_machine_stop!(TerminationInfo::Abort(format!(
"aborted execution: attempted to leave type `{}` uninitialized, which is invalid",
ty
)))
}
}

// Other
"exact_div" => {
let &[ref num, ref denom] = check_arg_count(args)?;
Expand Down

0 comments on commit 70dd979

Please sign in to comment.