diff options
author | ggujjula <43194746+ggujjula@users.noreply.github.com> | 2022-05-31 13:15:53 -0500 |
---|---|---|
committer | Will Estes <westes@users.noreply.github.com> | 2024-04-25 14:30:59 -0400 |
commit | 80d756484c29442cbb1cba6329d6da69a1fbaed1 (patch) | |
tree | 8de3a5289412136df64fe88ada140feeea3a5069 | |
parent | ccbd9f698be8c697e6385e87ff9c38de10ea8cb1 (diff) | |
download | flex-80d756484c29442cbb1cba6329d6da69a1fbaed1.tar.gz |
Add error messages to unreachable ends of switch statements
-rw-r--r-- | src/c99-flex.skl | 4 | ||||
-rw-r--r-- | src/cpp-flex.skl | 4 | ||||
-rw-r--r-- | src/go-flex.skl | 4 |
3 files changed, 12 insertions, 0 deletions
diff --git a/src/c99-flex.skl b/src/c99-flex.skl index 1999ec8..3d6d2fc 100644 --- a/src/c99-flex.skl +++ b/src/c99-flex.skl @@ -1220,6 +1220,8 @@ int yyinput (yyscan_t yyscanner) case EOB_ACT_CONTINUE_SCAN: yyscanner->yy_c_buf_p = yyscanner->yytext_ptr + offset; break; + default: + yypanic("unexpected return value from yy_get_next_buffer()", yyscanner); } } } @@ -2371,6 +2373,8 @@ m4_ifdef([[M4_MODE_FIND_ACTION_REJECT_OR_INTERACTIVE]], [[ yy_cp = yyscanner->yy_c_buf_p; yy_bp = yyscanner->yytext_ptr + YY_MORE_ADJ; goto yy_find_action; + default: + yypanic("unexpected return value from yy_get_next_buffer()", yyscanner); } /* end EOB inner switch */ } /* end if */ break; diff --git a/src/cpp-flex.skl b/src/cpp-flex.skl index a121845..757b9cb 100644 --- a/src/cpp-flex.skl +++ b/src/cpp-flex.skl @@ -2271,6 +2271,8 @@ m4_ifdef([[M4_MODE_FIND_ACTION_REJECT_OR_INTERACTIVE]], [[ yy_cp = YY_G(yy_c_buf_p); yy_bp = YY_G(yytext_ptr) + YY_MORE_ADJ; goto yy_find_action; + default: + YY_FATAL_ERROR("unexpected return value from yy_get_next_buffer()"); } /* end EOB inner switch */ } /* end if */ break; @@ -2795,6 +2797,8 @@ int yyFlexLexer::yyinput() case EOB_ACT_CONTINUE_SCAN: YY_G(yy_c_buf_p) = YY_G(yytext_ptr) + offset; break; + default: + YY_FATAL_ERROR("unexpected return value from yy_get_next_buffer()"); } } } diff --git a/src/go-flex.skl b/src/go-flex.skl index a945569..d1269d4 100644 --- a/src/go-flex.skl +++ b/src/go-flex.skl @@ -1127,6 +1127,8 @@ int yyinput(FlexLexer *yyscanner) case EOB_ACT_CONTINUE_SCAN: yyscanner->yyCBufP = yyscanner->yytext_ptr + offset; break; + default: + yypanic("unexpected return value from yy_get_next_buffer()", yyscanner); } } } @@ -2217,6 +2219,8 @@ m4_ifdef([[M4_MODE_FIND_ACTION_REJECT_OR_INTERACTIVE]], [[ yyCp = yyscanner->yyCBufP; yyBp = yyscanner->yytext_ptr + YY_MORE_ADJ; goto yyFindActionLabel; + default: + yypanic("unexpected return value from yy_get_next_buffer()", yyscanner); } /* end EOB inner switch */ } /* end if */ break; |