File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -57,6 +57,9 @@ yp_regexp_char_expect(yp_regexp_parser_t *parser, char value) {
5757// This advances the current token to the next instance of the given character.
5858static bool
5959yp_regexp_char_find (yp_regexp_parser_t * parser , char value ) {
60+ if (yp_regexp_char_is_eof (parser )) {
61+ return false;
62+ }
6063 const char * end = (const char * ) memchr (parser -> cursor , value , (size_t ) (parser -> end - parser -> cursor ));
6164 if (end == NULL ) {
6265 return false;
@@ -383,7 +386,7 @@ yp_regexp_parse_group(yp_regexp_parser_t *parser) {
383386 break ;
384387 case '\'' : { // named capture group
385388 const char * start = ++ parser -> cursor ;
386- if (yp_regexp_char_is_eof ( parser ) || !yp_regexp_char_find (parser , '\'' )) {
389+ if (!yp_regexp_char_find (parser , '\'' )) {
387390 return false;
388391 }
389392
You can’t perform that action at this time.
0 commit comments