Write intrinsic result to correct lvalue.
This commit is contained in:
parent
1eb66b6701
commit
6c6cea28bd
1 changed files with 10 additions and 6 deletions
|
@ -238,7 +238,14 @@ impl<'a, 'tcx: 'a, 'arena> Interpreter<'a, 'tcx, 'arena> {
|
||||||
match fn_ty.abi {
|
match fn_ty.abi {
|
||||||
Abi::RustIntrinsic => {
|
Abi::RustIntrinsic => {
|
||||||
let name = self.tcx.item_name(def_id).as_str();
|
let name = self.tcx.item_name(def_id).as_str();
|
||||||
try!(self.call_intrinsic(&name, substs, args))
|
match fn_ty.sig.0.output {
|
||||||
|
ty::FnConverging(ty) => {
|
||||||
|
let size = self.ty_size(ty);
|
||||||
|
try!(self.call_intrinsic(&name, substs, args,
|
||||||
|
return_ptr.unwrap(), size))
|
||||||
|
}
|
||||||
|
ty::FnDiverging => unimplemented!(),
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Abi::Rust | Abi::RustCall => {
|
Abi::Rust | Abi::RustCall => {
|
||||||
|
@ -308,12 +315,9 @@ impl<'a, 'tcx: 'a, 'arena> Interpreter<'a, 'tcx, 'arena> {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn call_intrinsic(&mut self, name: &str, substs: &'tcx Substs<'tcx>,
|
fn call_intrinsic(&mut self, name: &str, substs: &'tcx Substs<'tcx>,
|
||||||
args: &[mir::Operand<'tcx>]) -> EvalResult<TerminatorTarget>
|
args: &[mir::Operand<'tcx>], dest: Pointer, dest_size: usize)
|
||||||
|
-> EvalResult<TerminatorTarget>
|
||||||
{
|
{
|
||||||
let ret_ptr = &mir::Lvalue::ReturnPointer;
|
|
||||||
let dest = try!(self.eval_lvalue(ret_ptr));
|
|
||||||
let dest_size = self.lvalue_repr(ret_ptr).size();
|
|
||||||
|
|
||||||
match name {
|
match name {
|
||||||
"assume" => {}
|
"assume" => {}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue