aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2016-09-13 15:35:56 -0400
committerAndrew Kelley <superjoe30@gmail.com>2016-09-13 15:35:56 -0400
commit6abd8b640526aeb40d69d427a9c23a3f0fb4400a (patch)
treecbdc050d57bab9c96158a5f2377fd50374c76ee1 /src
parent56f83257993f92869049b53e8c72e03abdce9547 (diff)
downloadzig-6abd8b640526aeb40d69d427a9c23a3f0fb4400a.tar.gz
zig-6abd8b640526aeb40d69d427a9c23a3f0fb4400a.zip
fix crash with []type{} expression
Diffstat (limited to 'src')
-rw-r--r--src/analyze.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/analyze.cpp b/src/analyze.cpp
index cf396e5509..3ed246d1b5 100644
--- a/src/analyze.cpp
+++ b/src/analyze.cpp
@@ -489,7 +489,7 @@ TypeTableEntry *get_array_type(CodeGen *g, TypeTableEntry *child_type, uint64_t
return entry;
} else {
TypeTableEntry *entry = new_type_table_entry(TypeTableEntryIdArray);
- entry->type_ref = LLVMArrayType(child_type->type_ref, array_size);
+ entry->type_ref = child_type->type_ref ? LLVMArrayType(child_type->type_ref, array_size) : nullptr;
entry->zero_bits = (array_size == 0) || child_type->zero_bits;
entry->deep_const = child_type->deep_const;