提交 2b37d500 编写于 作者: R Ralf Jung

simplify determining size and alignment of a pointer

上级 b44babf2
......@@ -1704,13 +1704,7 @@ fn run_main<'a, 'tcx: 'a>(
}
// Return value
let ret_ptr = {
let ty = ecx.tcx.types.isize;
let layout = ecx.type_layout_with_substs(ty, Substs::empty())?;
let size = layout.size(&ecx.tcx.data_layout).bytes();
let align = layout.align(&ecx.tcx.data_layout).abi();
ecx.memory.allocate(size, align)?
};
let ret_ptr = ecx.memory.allocate(ecx.tcx.data_layout.pointer_size.bytes(), ecx.tcx.data_layout.pointer_align.abi())?;
cleanup_ptr = Some(ret_ptr);
// Push our stack frame
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册