@@ -363,17 +363,11 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
363363 Abi :: Scalar ( s) if force => Some ( s. primitive ( ) ) ,
364364 _ => None ,
365365 } ;
366- let read_provenance = |s : abi:: Primitive , size| {
367- // Should be just `s.is_ptr()`, but we support a Miri flag that accepts more
368- // questionable ptr-int transmutes.
369- let number_may_have_provenance = !M :: enforce_number_no_provenance ( self ) ;
370- s. is_ptr ( ) || ( number_may_have_provenance && size == self . pointer_size ( ) )
371- } ;
372366 if let Some ( s) = scalar_layout {
373367 let size = s. size ( self ) ;
374368 assert_eq ! ( size, mplace. layout. size, "abi::Scalar size does not match layout size" ) ;
375- let scalar =
376- alloc . read_scalar ( alloc_range ( Size :: ZERO , size) , read_provenance ( s , size ) ) ?;
369+ let scalar = alloc
370+ . read_scalar ( alloc_range ( Size :: ZERO , size) , /* read_provenance*/ s . is_ptr ( ) ) ?;
377371 return Ok ( Some ( ImmTy { imm : scalar. into ( ) , layout : mplace. layout } ) ) ;
378372 }
379373 let scalar_pair_layout = match mplace. layout . abi {
@@ -391,10 +385,12 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
391385 let ( a_size, b_size) = ( a. size ( self ) , b. size ( self ) ) ;
392386 let b_offset = a_size. align_to ( b. align ( self ) . abi ) ;
393387 assert ! ( b_offset. bytes( ) > 0 ) ; // in `operand_field` we use the offset to tell apart the fields
394- let a_val =
395- alloc. read_scalar ( alloc_range ( Size :: ZERO , a_size) , read_provenance ( a, a_size) ) ?;
396- let b_val =
397- alloc. read_scalar ( alloc_range ( b_offset, b_size) , read_provenance ( b, b_size) ) ?;
388+ let a_val = alloc. read_scalar (
389+ alloc_range ( Size :: ZERO , a_size) ,
390+ /*read_provenance*/ a. is_ptr ( ) ,
391+ ) ?;
392+ let b_val = alloc
393+ . read_scalar ( alloc_range ( b_offset, b_size) , /*read_provenance*/ b. is_ptr ( ) ) ?;
398394 return Ok ( Some ( ImmTy {
399395 imm : Immediate :: ScalarPair ( a_val, b_val) ,
400396 layout : mplace. layout ,
0 commit comments