Python points-to: Fix getattr() points-to.

This commit is contained in:
Mark Shannon
2019-05-10 16:36:09 +01:00
parent 8b28105677
commit a1bf071f55

View File

@@ -1951,10 +1951,13 @@ cached module Types {
module AttributePointsTo {
predicate pointsTo(AttrNode f, Context context, ObjectInternal value, ControlFlowNode origin) {
f.isLoad() and
predicate pointsTo(ControlFlowNode f, Context context, ObjectInternal value, ControlFlowNode origin) {
exists(EssaVariable var, string name, CfgOrigin orig |
var.getASourceUse() = f.getObject(name) and
f.isLoad() and
var.getASourceUse() = f.(AttrNode).getObject(name)
or
Expressions::getattr_call(f, var.getASourceUse(), context, _, name)
|
variableAttributePointsTo(var, context, name, value, orig) and
origin = orig.asCfgNodeOrHere(f)
)