forked from github/codeql
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request github#15166 from yoff/python/add-scope-entry-defi…
…nition-nodes Python: Add scope entry definition nodes
- Loading branch information
Showing
12 changed files
with
70 additions
and
16 deletions.
There are no files selected for viewing
5 changes: 5 additions & 0 deletions
5
python/ql/lib/change-notes/2023-12-20-add-scope-entry-definition-nodes.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
category: fix | ||
--- | ||
|
||
- We would previously confuse all captured variables into a single scope entry node. Now they each get their own node so they can be tracked properly. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 5 additions & 5 deletions
10
python/ql/test/experimental/dataflow/coverage/localFlow.expected
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
python/ql/test/library-tests/ApiGraphs/py3/test_crosstalk.expected
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
| test_crosstalk.py:8:16:8:18 | ControlFlowNode for f() | bar | | ||
| test_crosstalk.py:13:16:13:18 | ControlFlowNode for g() | baz | |
13 changes: 13 additions & 0 deletions
13
python/ql/test/library-tests/ApiGraphs/py3/test_crosstalk.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
|
||
def outer(): | ||
from foo import bar, baz | ||
|
||
def inner_bar(): | ||
f = bar | ||
g = baz | ||
return f() | ||
|
||
def inner_baz(): | ||
f = bar | ||
g = baz | ||
return g() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import python | ||
import semmle.python.ApiGraphs | ||
|
||
from API::CallNode callNode, string member | ||
where | ||
callNode = API::moduleImport("foo").getMember(member).getACall() and | ||
callNode.getLocation().getFile().getBaseName() = "test_crosstalk.py" | ||
select callNode, member |