@@ -467,22 +467,22 @@ impl<'a, 'mir, 'tcx, M: Machine<'a, 'mir, 'tcx>> InterpretCx<'a, 'mir, 'tcx, M>
467
467
mir_place : & mir:: Place < ' tcx > ,
468
468
layout : Option < TyLayout < ' tcx > > ,
469
469
) -> EvalResult < ' tcx , OpTy < ' tcx , M :: PointerTag > > {
470
- use rustc:: mir:: Place :: * ;
471
470
use rustc:: mir:: PlaceBase ;
472
- let op = match * mir_place {
473
- Base ( PlaceBase :: Local ( mir:: RETURN_PLACE ) ) => return err ! ( ReadFromReturnPointer ) ,
474
- Base ( PlaceBase :: Local ( local) ) => self . access_local ( self . frame ( ) , local, layout) ?,
475
471
476
- Projection ( ref proj) => {
477
- let op = self . eval_place_to_op ( & proj. base , None ) ?;
478
- self . operand_projection ( op, & proj. elem ) ?
479
- }
472
+ mir_place. iterate ( |place_base, place_projection| {
473
+ let mut op = match place_base {
474
+ PlaceBase :: Local ( mir:: RETURN_PLACE ) => return err ! ( ReadFromReturnPointer ) ,
475
+ PlaceBase :: Local ( local) => self . access_local ( self . frame ( ) , * local, layout) ?,
476
+ _ => self . eval_place_to_mplace ( mir_place) ?. into ( ) ,
477
+ } ;
480
478
481
- _ => self . eval_place_to_mplace ( mir_place) ?. into ( ) ,
482
- } ;
479
+ for proj in place_projection {
480
+ op = self . operand_projection ( op, & proj. elem ) ?
481
+ }
483
482
484
- trace ! ( "eval_place_to_op: got {:?}" , * op) ;
485
- Ok ( op)
483
+ trace ! ( "eval_place_to_op: got {:?}" , op) ;
484
+ Ok ( op)
485
+ } )
486
486
}
487
487
488
488
/// Evaluate the operand, returning a place where you can then find the data.
0 commit comments