提交 25a3be9c 编写于 作者: S Scott Olson

Handle Misc casts slightly more sanely.

Still insanely, though.
上级 23b504c2
......@@ -1045,8 +1045,14 @@ fn eval_assignment(&mut self, lvalue: &mir::Lvalue<'tcx>, rvalue: &mir::Rvalue<'
Misc => {
// FIXME(solson): Wrong for almost everything.
let size = dest_layout.size(&self.tcx.data_layout).bytes() as usize;
self.memory.copy(src, dest, size)?;
let dest_size = self.type_size(dest_ty, self.substs());
let src_size = self.type_size(src_ty, self.substs());
if dest_size == src_size {
warn!("performing fishy cast from {:?} to {:?}", src_ty, dest_ty);
self.memory.copy(src, dest, dest_size)?;
} else {
return Err(EvalError::Unimplemented(format!("can't handle cast: {:?}", rvalue)));
}
}
_ => return Err(EvalError::Unimplemented(format!("can't handle cast: {:?}", rvalue))),
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册