about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-11-15 17:37:15 +0000
committerbors <bors@rust-lang.org>2022-11-15 17:37:15 +0000
commit03e3cc5b77ac403e68c0dba25c7e4ad92f3a2da6 (patch)
treea3300f3be6008a6c9d64251e0cd9a0e69405f15d
parentf5caaea98a394f5186b6dbf99fcf1b2ad9ad78a0 (diff)
parentb5523e3e7a197bcb204cacf27097bffc2123e9fd (diff)
downloadrust-03e3cc5b77ac403e68c0dba25c7e4ad92f3a2da6.tar.gz
rust-03e3cc5b77ac403e68c0dba25c7e4ad92f3a2da6.zip
Auto merge of #104054 - RalfJung:byte-provenance, r=oli-obk
interpret: support for per-byte provenance

Also factors the provenance map into its own module.

The third commit does the same for the init mask. I can move it in a separate PR if you prefer.

Fixes https://github.com/rust-lang/miri/issues/2181

r? `@oli-obk`
-rw-r--r--src/constant.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/constant.rs b/src/constant.rs
index df1150ec0b8..c0c6c76473b 100644
--- a/src/constant.rs
+++ b/src/constant.rs
@@ -398,7 +398,7 @@ fn define_all_allocs(tcx: TyCtxt<'_>, module: &mut dyn Module, cx: &mut Constant
         let bytes = alloc.inspect_with_uninit_and_ptr_outside_interpreter(0..alloc.len()).to_vec();
         data_ctx.define(bytes.into_boxed_slice());
 
-        for &(offset, alloc_id) in alloc.provenance().iter() {
+        for &(offset, alloc_id) in alloc.provenance().ptrs().iter() {
             let addend = {
                 let endianness = tcx.data_layout.endian;
                 let offset = offset.bytes() as usize;
@@ -431,7 +431,7 @@ fn define_all_allocs(tcx: TyCtxt<'_>, module: &mut dyn Module, cx: &mut Constant
                     {
                         tcx.sess.fatal(&format!(
                             "Allocation {:?} contains reference to TLS value {:?}",
-                            alloc, def_id
+                            alloc_id, def_id
                         ));
                     }