aboutsummaryrefslogtreecommitdiff
path: root/src/ir.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2018-05-12 23:57:15 -0400
committerAndrew Kelley <superjoe30@gmail.com>2018-05-12 23:57:15 -0400
commit548ddd1f0c35033cd7e0d1940975bc7185bf7346 (patch)
tree0d60d99858bb8123a35ac68495c04347dee82fc0 /src/ir.cpp
parent7cdc9d98c7134be5edd18eb6f94dd8cfc55bb764 (diff)
downloadzig-548ddd1f0c35033cd7e0d1940975bc7185bf7346.tar.gz
zig-548ddd1f0c35033cd7e0d1940975bc7185bf7346.zip
fix AST dumping code in self hosted compiler
Diffstat (limited to 'src/ir.cpp')
-rw-r--r--src/ir.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/ir.cpp b/src/ir.cpp
index 7bc837d908..31d22ca82a 100644
--- a/src/ir.cpp
+++ b/src/ir.cpp
@@ -18083,7 +18083,11 @@ static TypeTableEntry *ir_analyze_instruction_check_switch_prongs(IrAnalyze *ira
if (type_is_invalid(end_value->value.type))
return ira->codegen->builtin_types.entry_invalid;
- assert(start_value->value.type->id == TypeTableEntryIdEnum);
+ if (start_value->value.type->id != TypeTableEntryIdEnum) {
+ ir_add_error(ira, range->start, buf_sprintf("not an enum type"));
+ return ira->codegen->builtin_types.entry_invalid;
+ }
+
BigInt start_index;
bigint_init_bigint(&start_index, &start_value->value.data.x_enum_tag);