File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -231,7 +231,8 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
231231 . collect :: < Vec < libffi:: high:: Arg < ' _ > > > ( ) ;
232232
233233 // Prepare all exposed memory (both previously exposed, and just newly exposed since a
234- // pointer was passed as argument).
234+ // pointer was passed as argument). Uninitialised memory is left as-is, but any data
235+ // exposed this way is garbage anyway.
235236 this. visit_reachable_allocs ( this. exposed_allocs ( ) , |this, alloc_id, info| {
236237 // If there is no data behind this pointer, skip this.
237238 if !matches ! ( info. kind, AllocKind :: LiveData ) {
@@ -251,8 +252,8 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
251252
252253 // Prepare for possible write from native code if mutable.
253254 if info. mutbl . is_mut ( ) {
254- let alloc = & mut this. get_alloc_raw_mut ( alloc_id) ?. 0 ;
255- alloc. prepare_for_native_access ( ) ;
255+ let ( alloc, cx ) = this. get_alloc_raw_mut ( alloc_id) ?;
256+ alloc. process_native_write ( & cx . tcx , None ) ;
256257 // Also expose *mutable* provenance for the interpreter-level allocation.
257258 std:: hint:: black_box ( alloc. get_bytes_unchecked_raw_mut ( ) . expose_provenance ( ) ) ;
258259 }
You can’t perform that action at this time.
0 commit comments