Skip to content

Commit edf1bfd

Browse files
committed
const-eval: fix and re-enable pointer fragment support
1 parent c46cf10 commit edf1bfd

File tree

2 files changed

+5
-17
lines changed

2 files changed

+5
-17
lines changed

src/machine.rs

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -351,21 +351,6 @@ impl interpret::Provenance for Provenance {
351351
}
352352
Ok(())
353353
}
354-
355-
fn join(left: Self, right: Self) -> Option<Self> {
356-
match (left, right) {
357-
// If both are the *same* concrete tag, that is the result.
358-
(
359-
Provenance::Concrete { alloc_id: left_alloc, tag: left_tag },
360-
Provenance::Concrete { alloc_id: right_alloc, tag: right_tag },
361-
) if left_alloc == right_alloc && left_tag == right_tag => Some(left),
362-
// If one side is a wildcard, the best possible outcome is that it is equal to the other
363-
// one, and we use that.
364-
(Provenance::Wildcard, o) | (o, Provenance::Wildcard) => Some(o),
365-
// Otherwise, fall back to `None`.
366-
_ => None,
367-
}
368-
}
369354
}
370355

371356
impl fmt::Debug for ProvenanceExtra {

src/shims/native_lib/mod.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,9 @@ trait EvalContextExtPriv<'tcx>: crate::MiriInterpCxExt<'tcx> {
256256
match evt {
257257
AccessEvent::Read(_) => {
258258
// If a provenance was read by the foreign code, expose it.
259-
for prov in alloc.provenance().get_range(this, overlap.into()) {
259+
for (_prov_range, prov) in
260+
alloc.provenance().get_range(overlap.into(), this)
261+
{
260262
this.expose_provenance(prov)?;
261263
}
262264
}
@@ -321,7 +323,8 @@ trait EvalContextExtPriv<'tcx>: crate::MiriInterpCxExt<'tcx> {
321323
// Expose all provenances in the allocation within the byte range of the struct, if
322324
// any. These pointers are being directly passed to native code by-value.
323325
let alloc = this.get_alloc_raw(id)?;
324-
for prov in alloc.provenance().get_range(this, range.clone().into()) {
326+
for (_prov_range, prov) in alloc.provenance().get_range(range.clone().into(), this)
327+
{
325328
expose(prov)?;
326329
}
327330
// Read the bytes that make up this argument. We cannot use the normal getter as

0 commit comments

Comments
 (0)