ladybird/Tests/LibRegex
Timothy Flynn 562d4e497b LibRegex: Treat pattern string characters as unsigned
For example, consider the following pattern:

    new RegExp('\ud834\udf06', 'u')

With this pattern, the regex parser should insert the UTF-8 encoded
bytes 0xf0, 0x9d, 0x8c, and 0x86. However, because these characters are
currently treated as normal char types, they have a negative value since
they are all > 0x7f. Then, due to sign extension, when these characters
are cast to u64, the sign bit is preserved. The result is that these
bytes are inserted as 0xfffffffffffffff0, 0xffffffffffffff9d, etc.

Fortunately, there are only a few places where we insert bytecode with
the raw characters. In these places, be sure to treat the bytes as u8
before they are cast to u64.
2021-08-20 19:16:33 +02:00
..
Benchmark.cpp Tests: Move LibRegex tests to Tests/LibRegex 2021-05-06 17:54:28 +02:00
CMakeLists.txt Tests: Move LibRegex tests to Tests/LibRegex 2021-05-06 17:54:28 +02:00
Regex.cpp LibRegex: Treat pattern string characters as unsigned 2021-08-20 19:16:33 +02:00
RegexLibC.cpp LibRegex: Correctly parse BRE bracket expressions 2021-07-10 22:58:24 +04:30