Fix parsing nul bytes in regex

Fixes #4460
This commit is contained in:
Maxime Coste 2021-12-11 09:01:03 +11:00
parent b65df4bebf
commit 7648d56fc3
4 changed files with 3 additions and 1 deletions

View File

@ -340,7 +340,7 @@ private:
case '|': case ')': case '|': case ')':
return {}; return {};
default: default:
if (contains("^$.*+?[]{}", cp) or (cp >= 0xF0000 and cp <= 0xFFFFF)) if (contains(StringView{"^$.*+?[]{}"}, cp) or (cp >= 0xF0000 and cp <= 0xFFFFF))
parse_error(format("unexpected '{}'", cp)); parse_error(format("unexpected '{}'", cp));
++m_pos; ++m_pos;
return add_node(ParsedRegex::Literal, cp); return add_node(ParsedRegex::Literal, cp);

View File

@ -0,0 +1 @@
*%s<ret>d

Binary file not shown.

View File

@ -0,0 +1 @@