Files
codeql/cpp/ql/lib/semmle/code/cpp
copilot-swe-agent[bot] bfb7b1d046 Commit 6: Fix POSIX-bracket mis-parses revealed by Commit 5
POSIX bracket expressions ([:name:], [.x.], [=x=]) are only valid nested
inside another character class in std::regex. The three predicates now
additionally require that at position `start` we are inside an outer
character class, approximated by requiring more non-escaped `[` than
non-escaped `]` before `start`. A well-formed POSIX bracket contributes
one `[` and one `]` at/after `start`, so the check is unaffected by
earlier POSIX brackets.

Also stop emitting individual charSetTokens for characters inside a
POSIX bracket (`inAnyPosixBracket` guard), which removes the spurious
`[RegExpCharacterRange] :]-z` on [[:alpha:]-z].

Post-fix, unnested `[:digit:]`, `[:alpha:]`, and `a[🅱️]c` are correctly
parsed as ordinary character classes / literal sequences rather than
`RegExpNamedCharacterProperty`; and the [[:alpha:]-z] range no longer
crosses the POSIX bracket boundary.

Bundle: github/codeql-action codeql-bundle-v2.26.1 (CodeQL CLI 2.26.1).
2026-07-21 12:24:52 +00:00
..
2026-03-09 17:45:38 +00:00
2026-05-26 17:54:51 +02:00
2026-02-20 16:24:19 +01:00
2026-05-22 13:13:25 +02:00
2025-09-03 08:19:18 +02:00
2023-10-25 14:05:38 +02:00
2026-05-22 13:13:25 +02:00
2026-05-26 17:54:51 +02:00
2025-06-27 14:42:08 +02:00
2024-10-16 11:33:18 +02:00
2024-01-22 09:11:35 +01:00
2025-06-27 14:42:08 +02:00
2026-05-22 13:13:25 +02:00
2025-01-24 16:12:16 +01:00
2026-05-22 13:13:25 +02:00