diff options
author | Jo-Philipp Wich <jo@mein.io> | 2021-04-29 00:31:06 +0200 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2021-04-29 00:31:06 +0200 |
commit | f73e20158641a96882565852d0e2a6bf1540d950 (patch) | |
tree | 800d1fbdfe4f068f897e794d7b114e3545099067 /lexer.c | |
parent | 86b4863837edbd9aaac1aeea3f0101076ef55f09 (diff) |
lexer: fix infinite loop when parsing regexp literal at EOF
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'lexer.c')
-rw-r--r-- | lexer.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -663,8 +663,8 @@ parse_regexp(uc_lexer *lex) case UT_LEX_PARSE_REGEX_FLAGS: rv = (uc_token *)lex->lookbehind; - while (lex->bufstart < lex->bufend) { - switch (lex->bufstart[0]) { + while (lex->bufstart < lex->bufend || lex->eof) { + switch (lex->eof ? EOF : lex->bufstart[0]) { case 'g': buf_consume(lex, 1); is_reg_global = true; |