Skip to content

Commit 3a19b1e

Browse files
yoffRasmusWL
andauthored
Apply suggestions from code review
Co-authored-by: Rasmus Wriedt Larsen <rasmuswriedtlarsen@gmail.com>
1 parent 2eb8ea8 commit 3a19b1e

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

python/ql/src/experimental/dataflow/internal/DataFlowPrivate.qll

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,7 @@ predicate simpleLocalFlowStep(Node nodeFrom, Node nodeTo) {
156156
}
157157

158158
/**
159-
* If a node `n` has a post-update node `pun(n)`, we want forward flow to go from
160-
* `pun(n)` as well as from `n`.
159+
* Holds if `result` is either `node`, or the post-update node for `node`.
161160
*/
162161
private Node update(Node node) {
163162
exists(PostUpdateNode pun |

python/ql/src/semmle/python/essa/SsaCompute.qll

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,9 @@ private module SsaComputeImpl {
391391
* between `b1` and `b2`.
392392
*/
393393
private predicate varBlockReaches(SsaSourceVariable v, BasicBlock b1, BasicBlock b2) {
394-
varOccursInBlock(v, b1) and b2 = b1.getASuccessor()
394+
varOccursInBlock(v, b1) and
395+
b2 = b1.getASuccessor() and
396+
blockPrecedesVar(v, b2)
395397
or
396398
exists(BasicBlock mid |
397399
varBlockReaches(v, b1, mid) and

0 commit comments

Comments
 (0)