absyntax_utils/type_initial_value.cc
changeset 870 9c6c588fd708
parent 850 484beb3b1dcb
child 925 a942c55fb769
--- a/absyntax_utils/type_initial_value.cc	Wed Feb 19 22:25:10 2014 +0100
+++ b/absyntax_utils/type_initial_value.cc	Wed Feb 19 22:27:11 2014 +0100
@@ -220,6 +220,8 @@
 /* helper symbol for enumerated_specification->enumerated_spec_init */
 /* enumerated_value_list ',' enumerated_value */
 void *type_initial_value_c::visit(enumerated_value_list_c *symbol) {
+  /* stage1_2 never creates an enumerated_value_list_c with no entries. If this occurs, then something must have changed! */
+  if (symbol->n <= 0) ERROR;
  /* if no initial value explicitly given, then use the lowest value of the subrange */
   return (void *)symbol->elements[0];
 }