fix regression with global variable assignment...

...with optional unwrapping with var initialized to undefined
This commit is contained in:
Andrew Kelley
2019-08-26 15:24:24 -04:00
parent d316f70450
commit ae65c236c5
3 changed files with 38 additions and 23 deletions

View File

@@ -3527,6 +3527,8 @@ static LLVMValueRef ir_render_store_ptr(CodeGen *g, IrExecutable *executable, Ir
}
static LLVMValueRef ir_render_var_ptr(CodeGen *g, IrExecutable *executable, IrInstructionVarPtr *instruction) {
if (instruction->base.value.special != ConstValSpecialRuntime)
return ir_llvm_value(g, &instruction->base);
ZigVar *var = instruction->var;
if (type_has_bits(var->var_type)) {
assert(var->value_ref);