Skip to content

Commit 0e7838a

Browse files
committed
Data flow: Sync files
1 parent c7aa31d commit 0e7838a

File tree

21 files changed

+96
-27
lines changed

21 files changed

+96
-27
lines changed

cpp/ql/src/semmle/code/cpp/dataflow/internal/DataFlowImpl.qll

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -615,7 +615,9 @@ private newtype TNodeExt =
615615
exists(Configuration config |
616616
nodeCand1(node1, config) and
617617
argumentValueFlowsThrough(call, node1, TContentSome(f1), TContentSome(f2), node2) and
618-
nodeCand1(node2, unbind(config))
618+
nodeCand1(node2, unbind(config)) and
619+
readStoreCand1(f1, unbind(config)) and
620+
readStoreCand1(f2, unbind(config))
619621
)
620622
}
621623

cpp/ql/src/semmle/code/cpp/dataflow/internal/DataFlowImpl2.qll

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -615,7 +615,9 @@ private newtype TNodeExt =
615615
exists(Configuration config |
616616
nodeCand1(node1, config) and
617617
argumentValueFlowsThrough(call, node1, TContentSome(f1), TContentSome(f2), node2) and
618-
nodeCand1(node2, unbind(config))
618+
nodeCand1(node2, unbind(config)) and
619+
readStoreCand1(f1, unbind(config)) and
620+
readStoreCand1(f2, unbind(config))
619621
)
620622
}
621623

cpp/ql/src/semmle/code/cpp/dataflow/internal/DataFlowImpl3.qll

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -615,7 +615,9 @@ private newtype TNodeExt =
615615
exists(Configuration config |
616616
nodeCand1(node1, config) and
617617
argumentValueFlowsThrough(call, node1, TContentSome(f1), TContentSome(f2), node2) and
618-
nodeCand1(node2, unbind(config))
618+
nodeCand1(node2, unbind(config)) and
619+
readStoreCand1(f1, unbind(config)) and
620+
readStoreCand1(f2, unbind(config))
619621
)
620622
}
621623

cpp/ql/src/semmle/code/cpp/dataflow/internal/DataFlowImpl4.qll

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -615,7 +615,9 @@ private newtype TNodeExt =
615615
exists(Configuration config |
616616
nodeCand1(node1, config) and
617617
argumentValueFlowsThrough(call, node1, TContentSome(f1), TContentSome(f2), node2) and
618-
nodeCand1(node2, unbind(config))
618+
nodeCand1(node2, unbind(config)) and
619+
readStoreCand1(f1, unbind(config)) and
620+
readStoreCand1(f2, unbind(config))
619621
)
620622
}
621623

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

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -383,17 +383,28 @@ private module Cached {
383383
contentOut = TContentNone() and
384384
compatibleTypes(getErasedNodeTypeBound(arg), getErasedNodeTypeBound(out))
385385
or
386-
// getter(+setter)
386+
// getter
387387
exists(Content fIn |
388388
contentIn.getContent() = fIn and
389-
compatibleTypes(getErasedNodeTypeBound(arg), fIn.getContainerType())
389+
contentOut = TContentNone() and
390+
compatibleTypes(getErasedNodeTypeBound(arg), fIn.getContainerType()) and
391+
compatibleTypes(fIn.getType(), getErasedNodeTypeBound(out))
390392
)
391393
or
392394
// setter
393395
exists(Content fOut |
394396
contentIn = TContentNone() and
395397
contentOut.getContent() = fOut and
396-
compatibleTypes(getErasedNodeTypeBound(arg), fOut.getType())
398+
compatibleTypes(getErasedNodeTypeBound(arg), fOut.getType()) and
399+
compatibleTypes(fOut.getContainerType(), getErasedNodeTypeBound(out))
400+
)
401+
or
402+
// getter+setter
403+
exists(Content fIn, Content fOut |
404+
contentIn.getContent() = fIn and
405+
contentOut.getContent() = fOut and
406+
compatibleTypes(getErasedNodeTypeBound(arg), fIn.getContainerType()) and
407+
compatibleTypes(fOut.getContainerType(), getErasedNodeTypeBound(out))
397408
)
398409
)
399410
}

cpp/ql/src/semmle/code/cpp/dataflow/internal/DataFlowImplLocal.qll

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -615,7 +615,9 @@ private newtype TNodeExt =
615615
exists(Configuration config |
616616
nodeCand1(node1, config) and
617617
argumentValueFlowsThrough(call, node1, TContentSome(f1), TContentSome(f2), node2) and
618-
nodeCand1(node2, unbind(config))
618+
nodeCand1(node2, unbind(config)) and
619+
readStoreCand1(f1, unbind(config)) and
620+
readStoreCand1(f2, unbind(config))
619621
)
620622
}
621623

cpp/ql/src/semmle/code/cpp/ir/dataflow/internal/DataFlowImpl.qll

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -615,7 +615,9 @@ private newtype TNodeExt =
615615
exists(Configuration config |
616616
nodeCand1(node1, config) and
617617
argumentValueFlowsThrough(call, node1, TContentSome(f1), TContentSome(f2), node2) and
618-
nodeCand1(node2, unbind(config))
618+
nodeCand1(node2, unbind(config)) and
619+
readStoreCand1(f1, unbind(config)) and
620+
readStoreCand1(f2, unbind(config))
619621
)
620622
}
621623

cpp/ql/src/semmle/code/cpp/ir/dataflow/internal/DataFlowImpl2.qll

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -615,7 +615,9 @@ private newtype TNodeExt =
615615
exists(Configuration config |
616616
nodeCand1(node1, config) and
617617
argumentValueFlowsThrough(call, node1, TContentSome(f1), TContentSome(f2), node2) and
618-
nodeCand1(node2, unbind(config))
618+
nodeCand1(node2, unbind(config)) and
619+
readStoreCand1(f1, unbind(config)) and
620+
readStoreCand1(f2, unbind(config))
619621
)
620622
}
621623

cpp/ql/src/semmle/code/cpp/ir/dataflow/internal/DataFlowImpl3.qll

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -615,7 +615,9 @@ private newtype TNodeExt =
615615
exists(Configuration config |
616616
nodeCand1(node1, config) and
617617
argumentValueFlowsThrough(call, node1, TContentSome(f1), TContentSome(f2), node2) and
618-
nodeCand1(node2, unbind(config))
618+
nodeCand1(node2, unbind(config)) and
619+
readStoreCand1(f1, unbind(config)) and
620+
readStoreCand1(f2, unbind(config))
619621
)
620622
}
621623

cpp/ql/src/semmle/code/cpp/ir/dataflow/internal/DataFlowImpl4.qll

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -615,7 +615,9 @@ private newtype TNodeExt =
615615
exists(Configuration config |
616616
nodeCand1(node1, config) and
617617
argumentValueFlowsThrough(call, node1, TContentSome(f1), TContentSome(f2), node2) and
618-
nodeCand1(node2, unbind(config))
618+
nodeCand1(node2, unbind(config)) and
619+
readStoreCand1(f1, unbind(config)) and
620+
readStoreCand1(f2, unbind(config))
619621
)
620622
}
621623

0 commit comments

Comments
 (0)