mirror of
https://github.com/github/codeql.git
synced 2026-05-02 04:05:14 +02:00
C++: Use the RelationalOperation class
This commit is contained in:
@@ -330,13 +330,7 @@ GlobalOrNamespaceVariable globalVarFromId(string id) {
|
||||
* A variable that has any kind of upper-bound check anywhere in the program
|
||||
*/
|
||||
private predicate hasUpperBoundsCheck(Variable var) {
|
||||
exists(BinaryOperation oper, VariableAccess access |
|
||||
(
|
||||
oper.getOperator() = "<" or
|
||||
oper.getOperator() = "<=" or
|
||||
oper.getOperator() = ">" or
|
||||
oper.getOperator() = ">="
|
||||
) and
|
||||
exists(RelationalOperation oper, VariableAccess access |
|
||||
oper.getLeftOperand() = access and
|
||||
access.getTarget() = var and
|
||||
// Comparing to 0 is not an upper bound check
|
||||
|
||||
Reference in New Issue
Block a user