aboutsummaryrefslogtreecommitdiffhomepage
path: root/fish_tests.cpp
diff options
context:
space:
mode:
authorGravatar ridiculousfish <corydoras@ridiculousfish.com>2013-12-26 14:52:15 -0800
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2013-12-26 14:52:15 -0800
commita6ca809a4e4873f3fd16e4a763001a109afc2185 (patch)
tree56b91b545fb1b7f2b9cd01c76e4d0ff7e2bba38e /fish_tests.cpp
parentc1a13ae8bcfed6d1ce38453e7fadb2fee887a283 (diff)
Fix for issue where last job_list in tree would have a -1 production_idx
because we never actually sent the terminal token type
Diffstat (limited to 'fish_tests.cpp')
-rw-r--r--fish_tests.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/fish_tests.cpp b/fish_tests.cpp
index af65b70a..83f8976d 100644
--- a/fish_tests.cpp
+++ b/fish_tests.cpp
@@ -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;