-9ae6cedb8d1e37469be1434642a3e403fce50a03
+8f5f8f916f00f7989a4ebf7b7dbfe1afd605f828
)?;
}
"__rust_realloc" => {
- let ptr = this.read_scalar(args[0])?.to_ptr()?;
let old_size = this.read_scalar(args[1])?.to_machine_usize(this)?;
let align = this.read_scalar(args[2])?.to_machine_usize(this)?;
let new_size = this.read_scalar(args[3])?.to_machine_usize(this)?;
if !align.is_power_of_two() {
throw_unsup!(HeapAllocNonPowerOfTwoAlignment(align));
}
+ let ptr = this.force_ptr(this.read_scalar(args[0])?.not_undef()?)?;
let align = Align::from_bytes(align).unwrap();
let new_ptr = this.memory.reallocate(
ptr,
// Do it in memory
let mplace = this.force_allocation(dest)?;
mplace.meta.unwrap_none();
- let ptr = mplace.ptr.to_ptr()?;
+ let ptr = mplace.ptr.assert_ptr();
// We know the return place is in-bounds
this.memory.get_raw_mut(ptr.alloc_id)?.mark_definedness(
ptr,
) -> InterpResult<'tcx> {
let this = self.eval_context_mut();
let protector = if protect { Some(this.frame().extra.call_id) } else { None };
- let ptr = place.ptr.to_ptr().expect("we should have a proper pointer");
+ let ptr = place.ptr.assert_ptr();
trace!(
"reborrow: {} reference {:?} derived from {:?} (pointee {}): {:?}, size {}",
kind,