Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/analyze.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1720,6 +1720,11 @@ static void resolve_enum_type(CodeGen *g, TypeTableEntry *enum_type) {
for (uint32_t i = 0; i < field_count; i += 1) {
TypeEnumField *enum_field = &enum_type->data.enumeration.fields[i];

if (enum_field->name == nullptr) {
add_node_error(g, decl_node, buf_sprintf("enum '%s' contains invalid field", buf_ptr(&enum_type->name)));
return;
}

// TODO send patch to LLVM to support APInt in createEnumerator instead of int64_t
// http://lists.llvm.org/pipermail/llvm-dev/2017-December/119456.html
di_enumerators[i] = ZigLLVMCreateDebugEnumerator(g->dbuilder, buf_ptr(enum_field->name),
Expand Down