]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_mir/interpret/memory.rs
canonicalize alloc ID before calling tag_static_base_pointer
[rust.git] / src / librustc_mir / interpret / memory.rs
index 048c5d7b1595666dc6581d7885ff43a9ade72559..f60307e468bd25c469add4d6af68dbc7abe62bbc 100644 (file)
@@ -150,7 +150,8 @@ pub fn new(tcx: TyCtxtAt<'tcx>, extra: M::MemoryExtra) -> Self {
     /// through a pointer that was created by the program.
     #[inline]
     pub fn tag_static_base_pointer(&self, ptr: Pointer) -> Pointer<M::PointerTag> {
-        ptr.with_tag(M::tag_static_base_pointer(&self.extra, ptr.alloc_id))
+        let id = M::canonical_alloc_id(self, ptr.alloc_id);
+        ptr.with_tag(M::tag_static_base_pointer(&self.extra, id))
     }
 
     pub fn create_fn_alloc(