mirror of
https://github.com/github/codeql.git
synced 2026-07-23 12:12:05 +02:00
- Remove `(?#...)` comment group support from ParseRegExp.qll (not in ECMAScript) - Remove `commentGroupStart` predicate - Remove `#` from `nonCapturingGroupStart` character list - Remove `commentGroupStart` call from `groupStart` - Fix misleading comment in test.cpp line 64 - Clarify RegExpConfig.qll documentation to accurately describe `any()` behavior
20 lines
699 B
Plaintext
20 lines
699 B
Plaintext
/**
|
|
* Test-only characterization: treats every C++ `StringLiteral` as a regular
|
|
* expression so that the test corpus in `test.cpp` populates `RegExp` without
|
|
* requiring a dataflow-based characterization.
|
|
*
|
|
* A production flow-config PR will narrow this to string literals that are
|
|
* actually passed to `std::regex` / `std::basic_regex`.
|
|
*/
|
|
|
|
private import semmle.code.cpp.regex.internal.ParseRegExp
|
|
|
|
/**
|
|
* Treats every `StringLiteral` as a `RegExp` for testing purposes.
|
|
* Production code should restrict this to literals that are actually used as
|
|
* regular expressions (e.g. passed to `std::regex`).
|
|
*/
|
|
class StdRegexStringLiteral extends RegExp {
|
|
StdRegexStringLiteral() { any() }
|
|
}
|