mirror of
https://github.com/rust-lang/rust.git
synced 2026-06-02 15:56:09 +03:00
Implement the move_val_init intrinsic.
This commit is contained in:
@@ -347,6 +347,17 @@ fn call_intrinsic(&mut self, name: &str, substs: &'tcx Substs<'tcx>,
|
||||
try!(self.memory.write_int(dest, 1, dest_size));
|
||||
}
|
||||
|
||||
"move_val_init" => {
|
||||
let ty = *substs.types.get(subst::FnSpace, 0);
|
||||
let size = self.ty_size(ty);
|
||||
|
||||
let ptr_arg = try!(self.eval_operand(&args[0]));
|
||||
let ptr = try!(self.memory.read_ptr(ptr_arg));
|
||||
|
||||
let val = try!(self.eval_operand(&args[1]));
|
||||
try!(self.memory.copy(val, ptr, size));
|
||||
}
|
||||
|
||||
// FIXME(tsion): Handle different integer types correctly.
|
||||
"mul_with_overflow" => {
|
||||
let ty = *substs.types.get(subst::FnSpace, 0);
|
||||
|
||||
Reference in New Issue
Block a user