diff --git a/src/compiler/build_tables/build_parse_table.cc b/src/compiler/build_tables/build_parse_table.cc index 50c84af7..d1d90455 100644 --- a/src/compiler/build_tables/build_parse_table.cc +++ b/src/compiler/build_tables/build_parse_table.cc @@ -394,7 +394,8 @@ class ParseTableBuilder { } else { ParseState &state = *iter; state.each_referenced_state([&new_state_ids](ParseStateId *state_index) { - *state_index = new_state_ids[*state_index]; + if (*state_index != (ParseStateId)(-1)) + *state_index = new_state_ids[*state_index]; }); ++iter; }