about summary refs log tree commit diff
path: root/compiler/rustc_const_eval/src/interpret
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2025-09-08 15:56:48 +0200
committerRalf Jung <post@ralfj.de>2025-09-10 08:40:12 +0200
commit64ea775d27599a33b070dd3aa4353e1e7faee0b4 (patch)
tree191ebabe50cfb67c95956e375f9feb81eed6376d /compiler/rustc_const_eval/src/interpret
parentbe8de5d6a0fc5cb2924e174a809a0aff303f281a (diff)
downloadrust-64ea775d27599a33b070dd3aa4353e1e7faee0b4.tar.gz
rust-64ea775d27599a33b070dd3aa4353e1e7faee0b4.zip
interpret: copy_provenance: avoid large intermediate buffer for large repeat counts
Diffstat (limited to 'compiler/rustc_const_eval/src/interpret')
-rw-r--r--compiler/rustc_const_eval/src/interpret/memory.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_const_eval/src/interpret/memory.rs b/compiler/rustc_const_eval/src/interpret/memory.rs
index 6ec85648d6d..43bcd34eb36 100644
--- a/compiler/rustc_const_eval/src/interpret/memory.rs
+++ b/compiler/rustc_const_eval/src/interpret/memory.rs
@@ -1503,7 +1503,7 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
         // This will also error if copying partial provenance is not supported.
         let provenance = src_alloc
             .provenance()
-            .prepare_copy(src_range, dest_offset, num_copies, self)
+            .prepare_copy(src_range, self)
             .map_err(|e| e.to_interp_error(src_alloc_id))?;
         // Prepare a copy of the initialization mask.
         let init = src_alloc.init_mask().prepare_copy(src_range);
@@ -1589,7 +1589,7 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
             num_copies,
         );
         // copy the provenance to the destination
-        dest_alloc.provenance_apply_copy(provenance);
+        dest_alloc.provenance_apply_copy(provenance, alloc_range(dest_offset, size), num_copies);
 
         interp_ok(())
     }