Python: Modernise Statements/ queries

Almost. Left out a few things marked with TODO
This commit is contained in:
Rasmus Wriedt Larsen
2020-02-12 13:01:05 +01:00
parent 83d40f167b
commit 13568b7b9f
22 changed files with 129 additions and 110 deletions

View File

@@ -14,13 +14,12 @@ import python
predicate string_concat_in_loop(BinaryExpr b) {
b.getOp() instanceof Add and
exists(SsaVariable d, SsaVariable u, BinaryExprNode add, ClassObject str_type |
exists(SsaVariable d, SsaVariable u, BinaryExprNode add |
add.getNode() = b and d = u.getAnUltimateDefinition()
|
d.getDefinition().(DefinitionNode).getValue() = add and
u.getAUse() = add.getAnOperand() and
add.getAnOperand().refersTo(_, str_type, _) and
(str_type = theBytesType() or str_type = theUnicodeType())
add.getAnOperand().pointsTo().getClass() = ClassValue::str()
)
}