Skip to content

Commit 4435279

Browse files
authored
Replace omittable exists variables with don't-care _
1 parent 9695195 commit 4435279

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

cpp/ql/lib/semmle/code/cpp/regex/RegexFlowConfigs.qll

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -245,17 +245,17 @@ predicate regexMatchedAgainst(StringLiteral regex, Expr str) {
245245
)
246246
) and
247247
// The regex variable is used as the regex argument to a match call.
248-
exists(Call matchCall, Expr regexArg |
249-
regexMatchCall(matchCall, regexArg, str) and
248+
exists(Expr regexArg |
249+
regexMatchCall(_, regexArg, str) and
250250
regexArg = v.getAnAccess()
251251
)
252252
)
253253
or
254254
// Also handle the pattern being passed inline to a match call (no named
255255
// variable): rare in practice for std::regex, but supported for
256256
// completeness.
257-
exists(Call matchCall, Expr regexArg |
258-
regexMatchCall(matchCall, regexArg, str) and
257+
exists(Expr regexArg |
258+
regexMatchCall(_, regexArg, str) and
259259
// The regex argument is a temporary `basic_regex(pattern)`.
260260
exists(ConstructorCall cc |
261261
cc.getTarget().getDeclaringType() instanceof StdBasicRegex and

cpp/ql/lib/semmle/code/cpp/regex/internal/ParseRegExp.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -855,7 +855,7 @@ abstract class RegExp extends StringLiteral {
855855
private predicate item_end(int end) {
856856
this.characterItem(_, end)
857857
or
858-
exists(int in_end | this.group_end(in_end, end))
858+
this.group_end(_, end)
859859
or
860860
this.charSet(_, end)
861861
or

0 commit comments

Comments
 (0)