Python points-to: Update sanity check.

This commit is contained in:
Mark Shannon
2019-04-09 17:18:57 +01:00
parent 03159bb31c
commit e21a863db9

View File

@@ -1,6 +1,7 @@
import python
import semmle.python.pointsto.PointsTo
import semmle.python.objects.ObjectInternal
predicate ssa_sanity(string clsname, string problem, string what) {
/* Exactly one definition of each SSA variable */
@@ -106,15 +107,6 @@ predicate ssa_sanity(string clsname, string problem, string what) {
) and
problem = "does not have an ImplicitModuleNameDefinition"
)
or
// Unknown value should always have the class unknownType
exists(ControlFlowNode f, ClassObject cls |
PointsTo::points_to(f, _, unknownValue(), cls, _) and
clsname = f.getAQlClass() and
cls != theUnknownType() and
problem = "unknownValue() has class != theUnknownType()" and
what = cls.getName()
)
}
from string clsname, string problem, string what