Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c1d3738

Browse files
committed
fix API-graphs such that the first parameter is the first non-self parameter
1 parent 547047e commit c1d3738

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

python/ql/lib/semmle/python/ApiGraphs.qll

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -595,8 +595,12 @@ module API {
595595
exists(DataFlow::Node def, PY::CallableExpr fn |
596596
rhs(base, def) and fn = trackDefNode(def).asExpr()
597597
|
598-
exists(int i |
599-
lbl = Label::parameter(i) and
598+
exists(int i, int offset |
599+
if exists(PY::Parameter p | p = fn.getInnerScope().getAnArg() and p.isSelf())
600+
then offset = 1
601+
else offset = 0
602+
|
603+
lbl = Label::parameter(i - offset) and
600604
ref.asExpr() = fn.getInnerScope().getArg(i)
601605
)
602606
or

0 commit comments

Comments
 (0)