mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 07:37:35 +00:00
LibRegex: Allow null bytes in pattern
That check was rather pointless as the input is a StringView which knows its own bounds. Fixes #9686.
This commit is contained in:
parent
0de35db0f1
commit
206bc01f81
2 changed files with 2 additions and 4 deletions
|
@ -660,6 +660,7 @@ TEST_CASE(ECMA262_match)
|
|||
{ "[\\0]"sv, "\0"sv, true, ECMAScriptFlags::BrowserExtended },
|
||||
{ "[\\0]"sv, "\0"sv, true, combine_flags(ECMAScriptFlags::Unicode, ECMAScriptFlags::BrowserExtended) },
|
||||
{ "[\\01]"sv, "\1"sv, true, ECMAScriptFlags::BrowserExtended },
|
||||
{ "(\0|a)"sv, "a"sv, true }, // #9686, Should allow null bytes in pattern
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
|
|
|
@ -109,7 +109,7 @@ Token Lexer::next()
|
|||
}
|
||||
};
|
||||
|
||||
while (m_index <= m_input.length()) {
|
||||
while (m_index < m_input.length()) {
|
||||
auto ch = peek();
|
||||
if (ch == '(')
|
||||
return emit_token(TokenType::LeftParen);
|
||||
|
@ -175,9 +175,6 @@ Token Lexer::next()
|
|||
}
|
||||
}
|
||||
|
||||
if (ch == '\0')
|
||||
break;
|
||||
|
||||
return emit_token(TokenType::Char);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue