mirror of
https://github.com/ziglang/zig.git
synced 2025-12-27 08:33:15 +00:00
stage1: stop emitting memset to undefined when safety is off
This commit is contained in:
parent
02f688d710
commit
46b57748a5
@ -5583,8 +5583,12 @@ static LLVMValueRef ir_render_memset(CodeGen *g, IrExecutableGen *executable, Ir
|
||||
|
||||
bool val_is_undef = value_is_all_undef(g, instruction->byte->value);
|
||||
LLVMValueRef fill_char;
|
||||
if (val_is_undef && ir_want_runtime_safety_scope(g, instruction->base.base.scope)) {
|
||||
fill_char = LLVMConstInt(LLVMInt8Type(), 0xaa, false);
|
||||
if (val_is_undef) {
|
||||
if (ir_want_runtime_safety_scope(g, instruction->base.base.scope)) {
|
||||
fill_char = LLVMConstInt(LLVMInt8Type(), 0xaa, false);
|
||||
} else {
|
||||
return nullptr;
|
||||
}
|
||||
} else {
|
||||
fill_char = ir_llvm_value(g, instruction->byte);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user