diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2018-06-21 17:41:49 -0400 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2018-06-21 17:41:49 -0400 |
| commit | 459d72f8736ebd8372b9050c17e5f3bc00092573 (patch) | |
| tree | 989e276143fcc59055202f234c7d2209b69ab6d5 /src | |
| parent | 5f38d6e2e97829ed74f06a96b5d07a2c68516063 (diff) | |
| download | zig-459d72f8736ebd8372b9050c17e5f3bc00092573.tar.gz zig-459d72f8736ebd8372b9050c17e5f3bc00092573.zip | |
fix compiler crash for invalid enum
closes #1079
closes #1147
Diffstat (limited to 'src')
| -rw-r--r-- | src/analyze.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/analyze.cpp b/src/analyze.cpp index 479abef16a..5160a19e81 100644 --- a/src/analyze.cpp +++ b/src/analyze.cpp @@ -2318,8 +2318,9 @@ static void resolve_enum_zero_bits(CodeGen *g, TypeTableEntry *enum_type) { return; if (enum_type->data.enumeration.zero_bits_loop_flag) { - enum_type->data.enumeration.zero_bits_known = true; - enum_type->data.enumeration.zero_bits_loop_flag = false; + add_node_error(g, enum_type->data.enumeration.decl_node, + buf_sprintf("'%s' depends on itself", buf_ptr(&enum_type->name))); + enum_type->data.enumeration.is_invalid = true; return; } |
