diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2016-12-28 01:31:46 -0500 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2016-12-28 01:31:46 -0500 |
| commit | f6ac2fa70e7e2eb5d3299dc90c581d139b0bea1b (patch) | |
| tree | a5f5e4c0135f24aafd07c9c7799083c4d8f75140 /src/ir.cpp | |
| parent | 25a5fc32fe68f911f7ac34e513e98cacb0ca17b1 (diff) | |
| download | zig-f6ac2fa70e7e2eb5d3299dc90c581d139b0bea1b.tar.gz zig-f6ac2fa70e7e2eb5d3299dc90c581d139b0bea1b.zip | |
IR: pass pointerToVoidReturnType test
Diffstat (limited to 'src/ir.cpp')
| -rw-r--r-- | src/ir.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/ir.cpp b/src/ir.cpp index 79fe3411d4..e7ca832f5d 100644 --- a/src/ir.cpp +++ b/src/ir.cpp @@ -4898,7 +4898,9 @@ static TypeTableEntry *ir_analyze_const_ptr(IrAnalyze *ira, IrInstruction *instr { if (pointee_type->id == TypeTableEntryIdMetaType) { TypeTableEntry *type_entry = pointee->data.x_type; - ConstExprValue *const_val = ir_build_const_from(ira, instruction, depends_on_compile_var || pointee->depends_on_compile_var); + ConstExprValue *const_val = ir_build_const_from(ira, instruction, + depends_on_compile_var || pointee->depends_on_compile_var); + type_ensure_zero_bits_known(ira->codegen, type_entry); const_val->data.x_type = get_pointer_to_type(ira->codegen, type_entry, ptr_is_const); return pointee_type; } else { @@ -7199,6 +7201,7 @@ static TypeTableEntry *ir_analyze_var_ptr(IrAnalyze *ira, IrInstruction *instruc return ir_analyze_const_ptr(ira, instruction, mem_slot, var->value.type, false, ptr_special, var->src_is_const); } else { ir_build_var_ptr_from(&ira->new_irb, instruction, var); + type_ensure_zero_bits_known(ira->codegen, var->value.type); return get_pointer_to_type(ira->codegen, var->value.type, var->src_is_const); } } |
