mirror of
https://github.com/github/codeql.git
synced 2026-04-30 11:15:13 +02:00
Python: Remove implied inequalities
Also gets rid of `inner_end`, since we're already doing `end - 1 = ...` in the other fix (and so this is more consistent).
This commit is contained in:
@@ -198,13 +198,11 @@ abstract class RegexString extends Expr {
|
||||
|
||||
/** Whether there is a character class, between start (inclusive) and end (exclusive) */
|
||||
predicate charSet(int start, int end) {
|
||||
exists(int inner_start, int inner_end |
|
||||
exists(int inner_start |
|
||||
this.char_set_start(start, inner_start) and
|
||||
not this.char_set_start(_, start)
|
||||
|
|
||||
end = inner_end + 1 and
|
||||
inner_end > inner_start and
|
||||
inner_end = min(int i | this.nonEscapedCharAt(i) = "]" and inner_start < i)
|
||||
end - 1 = min(int i | this.nonEscapedCharAt(i) = "]" and inner_start < i)
|
||||
)
|
||||
}
|
||||
|
||||
@@ -343,7 +341,6 @@ abstract class RegexString extends Expr {
|
||||
this.escapingChar(start) and
|
||||
this.getChar(start + 1) = "N" and
|
||||
this.getChar(start + 2) = "{" and
|
||||
end > start and
|
||||
end - 1 = min(int i | start + 2 < i and this.getChar(i) = "}")
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user