Skip to content

Commit ceaab16

Browse files
committed
force_ptr expects a Scalar
1 parent d8424a7 commit ceaab16

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/shims/foreign_items.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
278278
if old_size == 0 || new_size == 0 {
279279
throw_unsup!(HeapAllocZeroBytes);
280280
}
281-
let ptr = this.force_ptr(this.read_scalar(args[0])?)?;
281+
let ptr = this.force_ptr(this.read_scalar(args[0])?.not_undef()?)?;
282282
if !align.is_power_of_two() {
283283
throw_unsup!(HeapAllocNonPowerOfTwoAlignment(align));
284284
}

0 commit comments

Comments
 (0)