Skip to content

Commit 66d0bf6

Browse files
authored
Merge pull request github#5128 from hvitved/dataflow/exploration-clears-content
Data flow: Take `clearsContent()` into account in flow exploration
2 parents 9930d59 + 1f9b42f commit 66d0bf6

File tree

23 files changed

+46
-0
lines changed

23 files changed

+46
-0
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3598,6 +3598,7 @@ private module FlowExploration {
35983598
or
35993599
exists(PartialPathNodeRev mid |
36003600
revPartialPathStep(mid, node, sc1, sc2, ap, config) and
3601+
not clearsContent(node, ap.getHead()) and
36013602
not fullBarrier(node, config) and
36023603
distSink(node.getEnclosingCallable(), config) <= config.explorationLimit()
36033604
)
@@ -3611,6 +3612,7 @@ private module FlowExploration {
36113612
exists(PartialPathNodeFwd mid |
36123613
partialPathStep(mid, node, cc, sc1, sc2, ap, config) and
36133614
not fullBarrier(node, config) and
3615+
not clearsContent(node, ap.getHead().getContent()) and
36143616
if node instanceof CastingNode
36153617
then compatibleTypes(getNodeType(node), ap.getType())
36163618
else any()

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3598,6 +3598,7 @@ private module FlowExploration {
35983598
or
35993599
exists(PartialPathNodeRev mid |
36003600
revPartialPathStep(mid, node, sc1, sc2, ap, config) and
3601+
not clearsContent(node, ap.getHead()) and
36013602
not fullBarrier(node, config) and
36023603
distSink(node.getEnclosingCallable(), config) <= config.explorationLimit()
36033604
)
@@ -3611,6 +3612,7 @@ private module FlowExploration {
36113612
exists(PartialPathNodeFwd mid |
36123613
partialPathStep(mid, node, cc, sc1, sc2, ap, config) and
36133614
not fullBarrier(node, config) and
3615+
not clearsContent(node, ap.getHead().getContent()) and
36143616
if node instanceof CastingNode
36153617
then compatibleTypes(getNodeType(node), ap.getType())
36163618
else any()

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3598,6 +3598,7 @@ private module FlowExploration {
35983598
or
35993599
exists(PartialPathNodeRev mid |
36003600
revPartialPathStep(mid, node, sc1, sc2, ap, config) and
3601+
not clearsContent(node, ap.getHead()) and
36013602
not fullBarrier(node, config) and
36023603
distSink(node.getEnclosingCallable(), config) <= config.explorationLimit()
36033604
)
@@ -3611,6 +3612,7 @@ private module FlowExploration {
36113612
exists(PartialPathNodeFwd mid |
36123613
partialPathStep(mid, node, cc, sc1, sc2, ap, config) and
36133614
not fullBarrier(node, config) and
3615+
not clearsContent(node, ap.getHead().getContent()) and
36143616
if node instanceof CastingNode
36153617
then compatibleTypes(getNodeType(node), ap.getType())
36163618
else any()

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3598,6 +3598,7 @@ private module FlowExploration {
35983598
or
35993599
exists(PartialPathNodeRev mid |
36003600
revPartialPathStep(mid, node, sc1, sc2, ap, config) and
3601+
not clearsContent(node, ap.getHead()) and
36013602
not fullBarrier(node, config) and
36023603
distSink(node.getEnclosingCallable(), config) <= config.explorationLimit()
36033604
)
@@ -3611,6 +3612,7 @@ private module FlowExploration {
36113612
exists(PartialPathNodeFwd mid |
36123613
partialPathStep(mid, node, cc, sc1, sc2, ap, config) and
36133614
not fullBarrier(node, config) and
3615+
not clearsContent(node, ap.getHead().getContent()) and
36143616
if node instanceof CastingNode
36153617
then compatibleTypes(getNodeType(node), ap.getType())
36163618
else any()

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3598,6 +3598,7 @@ private module FlowExploration {
35983598
or
35993599
exists(PartialPathNodeRev mid |
36003600
revPartialPathStep(mid, node, sc1, sc2, ap, config) and
3601+
not clearsContent(node, ap.getHead()) and
36013602
not fullBarrier(node, config) and
36023603
distSink(node.getEnclosingCallable(), config) <= config.explorationLimit()
36033604
)
@@ -3611,6 +3612,7 @@ private module FlowExploration {
36113612
exists(PartialPathNodeFwd mid |
36123613
partialPathStep(mid, node, cc, sc1, sc2, ap, config) and
36133614
not fullBarrier(node, config) and
3615+
not clearsContent(node, ap.getHead().getContent()) and
36143616
if node instanceof CastingNode
36153617
then compatibleTypes(getNodeType(node), ap.getType())
36163618
else any()

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3598,6 +3598,7 @@ private module FlowExploration {
35983598
or
35993599
exists(PartialPathNodeRev mid |
36003600
revPartialPathStep(mid, node, sc1, sc2, ap, config) and
3601+
not clearsContent(node, ap.getHead()) and
36013602
not fullBarrier(node, config) and
36023603
distSink(node.getEnclosingCallable(), config) <= config.explorationLimit()
36033604
)
@@ -3611,6 +3612,7 @@ private module FlowExploration {
36113612
exists(PartialPathNodeFwd mid |
36123613
partialPathStep(mid, node, cc, sc1, sc2, ap, config) and
36133614
not fullBarrier(node, config) and
3615+
not clearsContent(node, ap.getHead().getContent()) and
36143616
if node instanceof CastingNode
36153617
then compatibleTypes(getNodeType(node), ap.getType())
36163618
else any()

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3598,6 +3598,7 @@ private module FlowExploration {
35983598
or
35993599
exists(PartialPathNodeRev mid |
36003600
revPartialPathStep(mid, node, sc1, sc2, ap, config) and
3601+
not clearsContent(node, ap.getHead()) and
36013602
not fullBarrier(node, config) and
36023603
distSink(node.getEnclosingCallable(), config) <= config.explorationLimit()
36033604
)
@@ -3611,6 +3612,7 @@ private module FlowExploration {
36113612
exists(PartialPathNodeFwd mid |
36123613
partialPathStep(mid, node, cc, sc1, sc2, ap, config) and
36133614
not fullBarrier(node, config) and
3615+
not clearsContent(node, ap.getHead().getContent()) and
36143616
if node instanceof CastingNode
36153617
then compatibleTypes(getNodeType(node), ap.getType())
36163618
else any()

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3598,6 +3598,7 @@ private module FlowExploration {
35983598
or
35993599
exists(PartialPathNodeRev mid |
36003600
revPartialPathStep(mid, node, sc1, sc2, ap, config) and
3601+
not clearsContent(node, ap.getHead()) and
36013602
not fullBarrier(node, config) and
36023603
distSink(node.getEnclosingCallable(), config) <= config.explorationLimit()
36033604
)
@@ -3611,6 +3612,7 @@ private module FlowExploration {
36113612
exists(PartialPathNodeFwd mid |
36123613
partialPathStep(mid, node, cc, sc1, sc2, ap, config) and
36133614
not fullBarrier(node, config) and
3615+
not clearsContent(node, ap.getHead().getContent()) and
36143616
if node instanceof CastingNode
36153617
then compatibleTypes(getNodeType(node), ap.getType())
36163618
else any()

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3598,6 +3598,7 @@ private module FlowExploration {
35983598
or
35993599
exists(PartialPathNodeRev mid |
36003600
revPartialPathStep(mid, node, sc1, sc2, ap, config) and
3601+
not clearsContent(node, ap.getHead()) and
36013602
not fullBarrier(node, config) and
36023603
distSink(node.getEnclosingCallable(), config) <= config.explorationLimit()
36033604
)
@@ -3611,6 +3612,7 @@ private module FlowExploration {
36113612
exists(PartialPathNodeFwd mid |
36123613
partialPathStep(mid, node, cc, sc1, sc2, ap, config) and
36133614
not fullBarrier(node, config) and
3615+
not clearsContent(node, ap.getHead().getContent()) and
36143616
if node instanceof CastingNode
36153617
then compatibleTypes(getNodeType(node), ap.getType())
36163618
else any()

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3598,6 +3598,7 @@ private module FlowExploration {
35983598
or
35993599
exists(PartialPathNodeRev mid |
36003600
revPartialPathStep(mid, node, sc1, sc2, ap, config) and
3601+
not clearsContent(node, ap.getHead()) and
36013602
not fullBarrier(node, config) and
36023603
distSink(node.getEnclosingCallable(), config) <= config.explorationLimit()
36033604
)
@@ -3611,6 +3612,7 @@ private module FlowExploration {
36113612
exists(PartialPathNodeFwd mid |
36123613
partialPathStep(mid, node, cc, sc1, sc2, ap, config) and
36133614
not fullBarrier(node, config) and
3615+
not clearsContent(node, ap.getHead().getContent()) and
36143616
if node instanceof CastingNode
36153617
then compatibleTypes(getNodeType(node), ap.getType())
36163618
else any()

0 commit comments

Comments
 (0)