Skip to content

Commit d1d05c8

Browse files
committed
Fix tagging order
1 parent 6e4264b commit d1d05c8

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/fn_call.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,19 +100,21 @@ pub trait EvalContextExt<'a, 'mir, 'tcx: 'a + 'mir>: crate::MiriEvalContextExt<'
100100
size
101101
} else {
102102
return err!(MachineError(format!(
103-
"calloc: overflow of items * size: {} * {}",
104-
items, size,
103+
"calloc: overflow of items * count: {} * {}",
104+
items, count,
105105
)));
106106
};
107107
if size == 0 {
108108
this.write_null(dest)?;
109109
} else {
110110
let align = this.tcx.data_layout.pointer_align.abi;
111-
let ptr = this.memory_mut().allocate(Size::from_bytes(size), align, MiriMemoryKind::C.into());
111+
let ptr = this.memory_mut()
112+
.allocate(Size::from_bytes(size), align, MiriMemoryKind::C.into())
113+
.with_default_tag();
112114
this.memory_mut()
113115
.get_mut(ptr.alloc_id)?
114116
.write_repeat(tcx, ptr, 0, Size::from_bytes(size))?;
115-
this.write_scalar(Scalar::Ptr(ptr.with_default_tag()), dest)?;
117+
this.write_scalar(Scalar::Ptr(ptr), dest)?;
116118
}
117119
}
118120
"posix_memalign" => {

0 commit comments

Comments
 (0)