Skip to content

Commit a4e189b

Browse files
committed
use get_range, but seems like structs can be imm now
1 parent 737875c commit a4e189b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/shims/native_lib/mod.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -326,11 +326,11 @@ trait EvalContextExtPriv<'tcx>: crate::MiriInterpCxExt<'tcx> {
326326
let alloc_ptr = this.get_alloc_bytes_unchecked_raw(id)?;
327327
let start_addr =
328328
mplace_ptr.addr().bytes_usize().strict_sub(alloc_ptr.addr());
329-
for byte in start_addr..start_addr.strict_add(sz) {
330-
if let Some(prov) = alloc.provenance().get(Size::from_bytes(byte), this)
331-
{
332-
this.expose_provenance(prov)?;
333-
}
329+
for prov in alloc
330+
.provenance()
331+
.get_range(this, (start_addr..start_addr.strict_add(sz)).into())
332+
{
333+
this.expose_provenance(prov)?;
334334
}
335335
// SAFETY: We know for sure that at mplace_ptr.addr() the next layout.size
336336
// bytes are part of this allocation and initialised. They might be marked

0 commit comments

Comments
 (0)