Skip to content

Commit b084467

Browse files
committed
unified: Tolerate missing post-update for RHS
1 parent 09fb8f1 commit b084467

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

‎unified/ql/consistency-queries/DataFlowConsistency.ql‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ private import codeql.dataflow.internal.DataFlowImplConsistency
55
module ConsistencyInput implements InputSig<Location, DataFlowInput> {
66
predicate argHasPostUpdateExclude(DataFlowInput::ArgumentNode n) {
77
not exists(n.getBasicBlock()) // ignore unreachable data flow nodes
8+
or
9+
// The RHS value passed into a setter call technically needs a post-update node
10+
// because it's an argument to a call, but this rarely matters in practice.
11+
n.isIncomingValue(any(DataFlowCall c).asSetterCall())
812
}
913

1014
predicate reverseReadExclude(DataFlow::Node n) {

0 commit comments

Comments
 (0)