authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2017-12-04 17:10:46-05:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2017-12-04 17:10:46-05:00
log5ebed1c9eeff6a190ff3d603bc6c680d4b920bd8
tree31d134d2a539a3fe866e8b4b90fbf06028fa6d5b
parenta966275e509670e750ef54a37f7202078aa4cf07

fix incorrect LLVM IR for union constant when active field is void

found in the llvm6 branch with llvm assertions on

1 files changed, 1 insertions(+), 1 deletions(-)

src/codegen.cpp+1-1
...@@ -3964,7 +3964,7 @@ static LLVMValueRef gen_const_val(CodeGen *g, ConstExprValue *const_val) {...@@ -3964,7 +3964,7 @@ static LLVMValueRef gen_const_val(CodeGen *g, ConstExprValue *const_val) {
3964 if (type_entry->data.unionation.gen_tag_index == SIZE_MAX)3964 if (type_entry->data.unionation.gen_tag_index == SIZE_MAX)
3965 return LLVMGetUndef(type_entry->type_ref);3965 return LLVMGetUndef(type_entry->type_ref);
39663966
3967 union_value_ref = LLVMGetUndef(type_entry->data.unionation.most_aligned_union_member->type_ref);3967 union_value_ref = LLVMGetUndef(union_type_ref);
3968 make_unnamed_struct = false;3968 make_unnamed_struct = false;
3969 } else {3969 } else {
3970 uint64_t field_type_bytes = LLVMStoreSizeOfType(g->target_data_ref, payload_value->type->type_ref);3970 uint64_t field_type_bytes = LLVMStoreSizeOfType(g->target_data_ref, payload_value->type->type_ref);