Commit 2e52fafac5

Shawn Landden <shawn@git.icu>
2019-11-07 05:00:39
correctly use llvm undef in release modes
1 parent 697c4ff
Changed files (1)
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);