Skip to content
Snippets Groups Projects
Commit 2b026cc7 authored by David Renshaw's avatar David Renshaw
Browse files

pull in some update Abi::RustCall code from miri

parent 40361afe
No related branches found
No related tags found
No related merge requests found
...@@ -438,12 +438,25 @@ impl<'a, 'tcx> EvalContext<'a, 'tcx> { ...@@ -438,12 +438,25 @@ impl<'a, 'tcx> EvalContext<'a, 'tcx> {
} }
Value::ByVal(PrimVal::Undef) => {} Value::ByVal(PrimVal::Undef) => {}
other => { other => {
assert_eq!(layout.fields.count(), 1); let mut layout = layout;
'outer: loop {
for i in 0..layout.fields.count() {
let field = layout.field(&self, i)?;
if layout.fields.offset(i).bytes() == 0 && layout.size == field.size {
layout = field;
continue 'outer;
}
}
break;
}
let dest = self.eval_lvalue(&mir::Place::Local( let dest = self.eval_lvalue(&mir::Place::Local(
arg_locals.next().unwrap(), arg_locals.next().unwrap(),
))?; ))?;
let field_ty = layout.field(&self, 0)?.ty; let valty = ValTy {
self.write_value(ValTy { value: other, ty: field_ty }, dest)?; value: other,
ty: layout.ty,
};
self.write_value(valty, dest)?;
} }
} }
} else { } else {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment