提交 49fb43f2 编写于 作者: D David Renshaw

use type_align() and type_size() instaed of size_and_align_of_dst()

上级 c8be3129
......@@ -385,8 +385,9 @@ pub(super) fn call_intrinsic(
"transmute" => {
let src_ty = substs.type_at(0);
let dest_ty = substs.type_at(1);
let (_, src_align) = self.size_and_align_of_dst(src_ty, arg_vals[0])?;
let (size, dest_align) = self.size_and_align_of_dst(dest_ty, arg_vals[0])?;
let src_align = self.type_align(src_ty)?;
let dest_align = self.type_align(dest_ty)?;
let size = self.type_size(dest_ty)?.expect("transmute() type must be sized");
if dest_align < src_align {
let ptr = self.force_allocation(dest)?.to_ptr();
self.memory.mark_packed(ptr, size);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册