Skip to content

Commit e6b1fe9

Browse files
committed
Fluent interface dataflow: support argument-output flow directly declared by the simpleLocalFlowStep relation
This means we will treat fluent interfaces that are modelled the same as those where we determine an argument flows to an output by inspection of the function body.
1 parent 54caf50 commit e6b1fe9

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

java/ql/src/semmle/code/java/dataflow/internal/DataFlowImplCommon.qll

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,14 @@ private module Cached {
427427
fromPre = fromNode.(PostUpdateNode).getPreUpdateNode() and
428428
toPre = toNode.(PostUpdateNode).getPreUpdateNode()
429429
|
430+
exists(DataFlowCall c |
431+
// Does the language-specific simpleLocalFlowStep already model flow
432+
// from function input to output?
433+
fromPre = getAnOutNode(c, _) and
434+
toPre.(ArgumentNode).argumentOf(c, _) and
435+
simpleLocalFlowStep(toPre.(ArgumentNode), fromPre)
436+
)
437+
or
430438
argumentValueFlowsThrough(toPre, TReadStepTypesNone(), fromPre)
431439
)
432440
}

0 commit comments

Comments
 (0)