Merge pull request #2945 from BekaValentine/python-objectapi-to-valueapi-calltosuperwrongclass

Python: ObjectAPI to ValueAPI: CallToSuperWrongClass
This commit is contained in:
Taus
2020-03-03 18:38:58 +01:00
committed by GitHub

View File

@@ -17,13 +17,13 @@ import python
from CallNode call_to_super, string name
where
exists(GlobalVariable gv, ControlFlowNode cn |
call_to_super = theSuperType().getACall() and
call_to_super = ClassValue::super_().getACall() and
gv.getId() = "super" and
cn = call_to_super.getArg(0) and
name = call_to_super.getScope().getScope().(Class).getName() and
exists(ClassObject other |
cn.refersTo(other) and
not other.getPyClass().getName() = name
exists(ClassValue other |
cn.pointsTo(other) and
not other.getScope().getName() = name
)
)
select call_to_super.getNode(), "First argument to super() should be " + name + "."