Special case ZST's in Rvalue::Repeat
Fixes #1146 by preventing a hang for [(); usize::MAX], which is used in a test of libcore.
This commit is contained in:
parent
6b58ed225e
commit
578fcdef5f
@ -660,7 +660,9 @@ fn codegen_stmt<'tcx>(
|
||||
.val
|
||||
.try_to_bits(fx.tcx.data_layout.pointer_size)
|
||||
.unwrap();
|
||||
if fx.clif_type(operand.layout().ty) == Some(types::I8) {
|
||||
if operand.layout().size.bytes() == 0 {
|
||||
// Do nothing for ZST's
|
||||
} else if fx.clif_type(operand.layout().ty) == Some(types::I8) {
|
||||
let times = fx.bcx.ins().iconst(fx.pointer_type, times as i64);
|
||||
// FIXME use emit_small_memset where possible
|
||||
let addr = lval.to_ptr().get_addr(fx);
|
||||
|
Loading…
x
Reference in New Issue
Block a user