提交 730098bc 编写于 作者: R Ralf Jung

avoid allocating for ZST

上级 ad009ae7
......@@ -261,9 +261,12 @@ pub fn read_scalar(&self, op : OpTy<'tcx>) -> EvalResult<'tcx, ScalarMaybeUndef>
}
pub fn uninit_operand(&mut self, layout: TyLayout<'tcx>) -> EvalResult<'tcx, Operand> {
// FIXME: Aren't we supposed to also be immediate for a ZST?
// This decides which types we will use the Immediate optimization for, and hence should
// match what `try_read_value` and `eval_place_to_op` support.
if layout.is_zst() {
return Ok(Operand::Immediate(Value::Scalar(ScalarMaybeUndef::Undef)));
}
Ok(match layout.abi {
layout::Abi::Scalar(..) =>
Operand::Immediate(Value::Scalar(ScalarMaybeUndef::Undef)),
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册