libassert
libassert copied to clipboard
Runtime error with regular expressions in libc++
terminating with uncaught exception of type std::__1::regex_error: The expression contained an invalid back reference.
zsh: abort ./a.out
Thrown on line 1080 https://github.com/jeremy-rifkin/libassert/blob/39a1babf70585e4b2e2361adc257da3ed6ae792e/src/assert.cpp#L1074-L1081
The problematic regex is ^((?:(?:u8|[UuL])?'(?:\\[0-7]{1,3}|\\x[\da-fA-F]+|\\.|[^\n'])*')|(?:(?:u8|[UuL])?R"([^ ()\\t\r\v\n]*)\((?:(?!\)\2\").)*\)\2")|(?:(?:u8|[UuL])?"(?:\\[0-7]{1,3}|\\x[\da-fA-F]+|\\.|[^\n"])*"))[^]*
Minimal reproducible regex is (x*)\s+(?!\1).+
https://godbolt.org/z/3h1hfrGeP
(For future reference: Reported at https://github.com/llvm/llvm-project/issues/55357)