authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-06-17 06:07:53-04:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-06-18 17:12:56-04:00
log46b57748a52c32b973903166d40c7ebee53d88c5
treec818d1a7fdd99bbc8eb38fae78ded8a7effffbd0
parent02f688d710312a43a56a3a24b769778a5aafc5da

stage1: stop emitting memset to undefined when safety is off


1 files changed, 6 insertions(+), 2 deletions(-)

src/codegen.cpp+6-2
...@@ -5583,8 +5583,12 @@ static LLVMValueRef ir_render_memset(CodeGen *g, IrExecutableGen *executable, Ir...@@ -5583,8 +5583,12 @@ static LLVMValueRef ir_render_memset(CodeGen *g, IrExecutableGen *executable, Ir
55835583
5584 bool val_is_undef = value_is_all_undef(g, instruction->byte->value);5584 bool val_is_undef = value_is_all_undef(g, instruction->byte->value);
5585 LLVMValueRef fill_char;5585 LLVMValueRef fill_char;
5586 if (val_is_undef && ir_want_runtime_safety_scope(g, instruction->base.base.scope)) {5586 if (val_is_undef) {
5587 fill_char = LLVMConstInt(LLVMInt8Type(), 0xaa, false);5587 if (ir_want_runtime_safety_scope(g, instruction->base.base.scope)) {
5588 fill_char = LLVMConstInt(LLVMInt8Type(), 0xaa, false);
5589 } else {
5590 return nullptr;
5591 }
5588 } else {5592 } else {
5589 fill_char = ir_llvm_value(g, instruction->byte);5593 fill_char = ir_llvm_value(g, instruction->byte);
5590 }5594 }