diff --git a/src/librustc_mir/interpret/terminator/mod.rs b/src/librustc_mir/interpret/terminator/mod.rs index 634a0c9ada8..9151bfbdd1b 100644 --- a/src/librustc_mir/interpret/terminator/mod.rs +++ b/src/librustc_mir/interpret/terminator/mod.rs @@ -291,10 +291,10 @@ impl<'a, 'mir, 'tcx, M: Machine<'mir, 'tcx>> EvalContext<'a, 'mir, 'tcx, M> { // and need to pack arguments Abi::Rust => { trace!( - "arg_locals: {:?}", + "arg_locals: {:#?}", self.frame().mir.args_iter().collect::>() ); - trace!("args: {:?}", args); + trace!("args: {:#?}", args); let local = arg_locals.nth(1).unwrap(); for (i, &valty) in args.into_iter().enumerate() { let dest = self.eval_place(&mir::Place::Local(local).field( @@ -321,10 +321,10 @@ impl<'a, 'mir, 'tcx, M: Machine<'mir, 'tcx>> EvalContext<'a, 'mir, 'tcx, M> { let mut arg_locals = self.frame().mir.args_iter(); trace!("ABI: {:?}", sig.abi); trace!( - "arg_locals: {:?}", + "arg_locals: {:#?}", self.frame().mir.args_iter().collect::>() ); - trace!("args: {:?}", args); + trace!("args: {:#?}", args); match sig.abi { Abi::RustCall => { assert_eq!(args.len(), 2); @@ -376,14 +376,26 @@ impl<'a, 'mir, 'tcx, M: Machine<'mir, 'tcx>> EvalContext<'a, 'mir, 'tcx, M> { } break; } - let dest = self.eval_place(&mir::Place::Local( - arg_locals.next().unwrap(), - ))?; - let valty = ValTy { - value: other, - ty: layout.ty, - }; - self.write_value(valty, dest)?; + { + let mut write_next = |value| { + let dest = self.eval_place(&mir::Place::Local( + arg_locals.next().unwrap(), + ))?; + let valty = ValTy { + value: Value::Scalar(value), + ty: layout.ty, + }; + self.write_value(valty, dest) + }; + match other { + Value::Scalar(value) | Value::ScalarPair(value, _) => write_next(value)?, + _ => unreachable!(), + } + if let Value::ScalarPair(_, value) = other { + write_next(value)?; + } + } + assert!(arg_locals.next().is_none()); } } } else { diff --git a/src/tools/miri b/src/tools/miri index 49ca1746482..ac667d372f4 160000 --- a/src/tools/miri +++ b/src/tools/miri @@ -1 +1 @@ -Subproject commit 49ca1746482e3c8221d8e8c7161b7d92ae076c8f +Subproject commit ac667d372f4094debfb9b7e29041f9e4a874fa6c