motiejus/zig

fork of https://codeberg.org/ziglang/zig
git clone https://git.jakstys.lt/motiejus/zig.git
Log | Tree | Refs | README | LICENSE

commit 2e52fafac50b545b5ef7dce42d0827e8077a8698 (tree)
parent 697c4ffd41cb99efbcf2e2c5393dd07533552881
Author: Shawn Landden <shawn@git.icu>
Date:   Wed,  6 Nov 2019 20:00:39 -0800

correctly use llvm undef in release modes

Diffstat:
Msrc/codegen.cpp | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/codegen.cpp b/src/codegen.cpp @@ -5128,7 +5128,7 @@ static LLVMValueRef ir_render_memset(CodeGen *g, IrExecutable *executable, IrIns bool val_is_undef = value_is_all_undef(g, &instruction->byte->value); LLVMValueRef fill_char; - if (val_is_undef) { + if (val_is_undef && ir_want_runtime_safety_scope(g, instruction->base.scope)) { fill_char = LLVMConstInt(LLVMInt8Type(), 0xaa, false); } else { fill_char = ir_llvm_value(g, instruction->byte);