Fix for issue where last job_list in tree would have a -1 production_idx

because we never actually sent the terminal token type
This commit is contained in:
ridiculousfish
2013-12-26 14:52:15 -08:00
parent c1a13ae8bc
commit a6ca809a4e
3 changed files with 31 additions and 9 deletions

View File

@@ -2212,6 +2212,12 @@ static bool increment(std::vector<parser_fuzz_token_t> &tokens)
if (! incremented_in_keyword)
{
token.token_type++;
// Skip the very special parse_token_type_terminate, since that's always the last thing delivered
if (token.token_type == parse_token_type_terminate)
{
token.token_type++;
}
if (token.token_type > LAST_TERMINAL_TYPE)
{
token.token_type = FIRST_TERMINAL_TYPE;