Skip to content

Commit 2d7d45a

Browse files
committed
Dataflow: Account for hidden nodes.
1 parent 3c3d71d commit 2d7d45a

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImpl.qll

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3258,24 +3258,16 @@ class PathNode extends TPathNode {
32583258
/** Gets the associated configuration. */
32593259
Configuration getConfiguration() { none() }
32603260

3261-
private predicate isHidden() {
3262-
hiddenNode(this.(PathNodeImpl).getNodeEx().asNode()) and
3263-
not this.isSource() and
3264-
not this instanceof PathNodeSink
3265-
or
3266-
this.(PathNodeImpl).getNodeEx() instanceof TNodeImplicitRead
3267-
}
3268-
32693261
private PathNode getASuccessorIfHidden() {
3270-
this.isHidden() and
3262+
this.(PathNodeImpl).isHidden() and
32713263
result = this.(PathNodeImpl).getASuccessorImpl()
32723264
}
32733265

32743266
/** Gets a successor of this node, if any. */
32753267
final PathNode getASuccessor() {
32763268
result = this.(PathNodeImpl).getASuccessorImpl().getASuccessorIfHidden*() and
3277-
not this.isHidden() and
3278-
not result.isHidden()
3269+
not this.(PathNodeImpl).isHidden() and
3270+
not result.(PathNodeImpl).isHidden()
32793271
}
32803272

32813273
/** Holds if this node is a source. */
@@ -3287,6 +3279,14 @@ abstract private class PathNodeImpl extends PathNode {
32873279

32883280
abstract NodeEx getNodeEx();
32893281

3282+
predicate isHidden() {
3283+
hiddenNode(this.getNodeEx().asNode()) and
3284+
not this.isSource() and
3285+
not this instanceof PathNodeSink
3286+
or
3287+
this.getNodeEx() instanceof TNodeImplicitRead
3288+
}
3289+
32903290
private string ppAp() {
32913291
this instanceof PathNodeSink and result = ""
32923292
or
@@ -3674,7 +3674,8 @@ private module Subpaths {
36743674
innercc = ret.getCallContext() and
36753675
sc = ret.getSummaryCtx() and
36763676
ret.getConfiguration() = unbindConf(getPathNodeConf(arg)) and
3677-
apout = ret.getAp()
3677+
apout = ret.getAp() and
3678+
not ret.isHidden()
36783679
)
36793680
}
36803681

@@ -3695,7 +3696,7 @@ private module Subpaths {
36953696
}
36963697

36973698
/**
3698-
* Holds if `n` can reach `ret` in a summarized subpath.
3699+
* Holds if `n` can reach a return node in a summarized subpath.
36993700
*/
37003701
predicate retReach(PathNode n) {
37013702
subpaths(_, _, n, _)

0 commit comments

Comments
 (0)