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> {
231
231
. collect :: < Vec < libffi:: high:: Arg < ' _ > > > ( ) ;
232
232
233
233
// 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.
235
236
this. visit_reachable_allocs ( this. exposed_allocs ( ) , |this, alloc_id, info| {
236
237
// If there is no data behind this pointer, skip this.
237
238
if !matches ! ( info. kind, AllocKind :: LiveData ) {
@@ -251,8 +252,8 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
251
252
252
253
// Prepare for possible write from native code if mutable.
253
254
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 ) ;
256
257
// Also expose *mutable* provenance for the interpreter-level allocation.
257
258
std:: hint:: black_box ( alloc. get_bytes_unchecked_raw_mut ( ) . expose_provenance ( ) ) ;
258
259
}
You can’t perform that action at this time.
0 commit comments