]> git.lizzy.rs Git - rust.git/blobdiff - src/tools/miri/src/shims/mod.rs
Rollup merge of #105174 - chenyukang:yukang/fix-105028-unused, r=eholk
[rust.git] / src / tools / miri / src / shims / mod.rs
index dcb99a27668261dc35553f411e5437374bbe9f2a..b6efad6b5ee0803c8cb111a1298e07bf85b9e11c 100644 (file)
@@ -89,6 +89,12 @@ fn align_offset(
         }
 
         let ptr = this.read_pointer(ptr_op)?;
+        // If this carries no provenance, treat it like an integer.
+        if ptr.provenance.is_none() {
+            // Use actual implementation.
+            return Ok(false);
+        }
+
         if let Ok((alloc_id, _offset, _)) = this.ptr_try_get_alloc_id(ptr) {
             // Only do anything if we can identify the allocation this goes to.
             let (_size, cur_align, _kind) = this.get_alloc_info(alloc_id);