From ffb3b1576b1c02942bce89ef05eaf05fe2f026ac Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Wed, 5 Sep 2018 16:19:58 -0400 Subject: stage1: fix tagged union with no payloads closes #1478 --- src/codegen.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/codegen.cpp') diff --git a/src/codegen.cpp b/src/codegen.cpp index 2f7a25cf93..f5c1019892 100644 --- a/src/codegen.cpp +++ b/src/codegen.cpp @@ -5490,7 +5490,7 @@ static LLVMValueRef gen_const_val(CodeGen *g, ConstExprValue *const_val, const c LLVMTypeRef union_type_ref = type_entry->data.unionation.union_type_ref; if (type_entry->data.unionation.gen_field_count == 0) { - if (type_entry->data.unionation.gen_tag_index == SIZE_MAX) { + if (type_entry->data.unionation.tag_type == nullptr) { return nullptr; } else { return bigint_to_llvm_const(type_entry->data.unionation.tag_type->type_ref, -- cgit v1.2.3