# HG changeset patch # User Mario de Sousa # Date 1378588089 -3600 # Node ID 484beb3b1dcbb5b21e1e082e41a73ea4d76d34bf # Parent 1f8885ae539a79539c3bd793749cc07a5136d957 Add assertion suggested by Manuele. diff -r 1f8885ae539a -r 484beb3b1dcb absyntax_utils/type_initial_value.cc --- a/absyntax_utils/type_initial_value.cc Fri Aug 23 15:13:11 2013 +0100 +++ b/absyntax_utils/type_initial_value.cc Sat Sep 07 22:08:09 2013 +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]; }