Skip to content

Commit 6a8c570

Browse files
authored
Merge pull request github#12009 from MathiasVP/fix-fwd-flow-read-join
DataFlow: Fix join in `fwdFlowRead`
2 parents 6c0b50c + 95b1582 commit 6a8c570

40 files changed

+200
-40
lines changed

cpp/ql/lib/experimental/semmle/code/cpp/ir/dataflow/internal/DataFlowImpl.qll

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1487,14 +1487,18 @@ private module MkStage<StageSig PrevStage> {
14871487
PrevStage::readStepCand(node1, _, _, config)
14881488
}
14891489

1490+
bindingset[ap, c]
1491+
pragma[inline_late]
1492+
private predicate hasHeadContent(Ap ap, Content c) { getHeadContent(ap) = c }
1493+
14901494
pragma[nomagic]
14911495
private predicate fwdFlowRead(
14921496
Ap ap, Content c, NodeEx node1, NodeEx node2, FlowState state, Cc cc,
14931497
ParamNodeOption summaryCtx, ApOption argAp, Configuration config
14941498
) {
14951499
fwdFlowRead0(node1, state, cc, summaryCtx, argAp, ap, config) and
14961500
PrevStage::readStepCand(node1, c, node2, config) and
1497-
getHeadContent(ap) = c
1501+
hasHeadContent(ap, c)
14981502
}
14991503

15001504
pragma[nomagic]

cpp/ql/lib/experimental/semmle/code/cpp/ir/dataflow/internal/DataFlowImpl2.qll

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1487,14 +1487,18 @@ private module MkStage<StageSig PrevStage> {
14871487
PrevStage::readStepCand(node1, _, _, config)
14881488
}
14891489

1490+
bindingset[ap, c]
1491+
pragma[inline_late]
1492+
private predicate hasHeadContent(Ap ap, Content c) { getHeadContent(ap) = c }
1493+
14901494
pragma[nomagic]
14911495
private predicate fwdFlowRead(
14921496
Ap ap, Content c, NodeEx node1, NodeEx node2, FlowState state, Cc cc,
14931497
ParamNodeOption summaryCtx, ApOption argAp, Configuration config
14941498
) {
14951499
fwdFlowRead0(node1, state, cc, summaryCtx, argAp, ap, config) and
14961500
PrevStage::readStepCand(node1, c, node2, config) and
1497-
getHeadContent(ap) = c
1501+
hasHeadContent(ap, c)
14981502
}
14991503

15001504
pragma[nomagic]

cpp/ql/lib/experimental/semmle/code/cpp/ir/dataflow/internal/DataFlowImpl3.qll

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1487,14 +1487,18 @@ private module MkStage<StageSig PrevStage> {
14871487
PrevStage::readStepCand(node1, _, _, config)
14881488
}
14891489

1490+
bindingset[ap, c]
1491+
pragma[inline_late]
1492+
private predicate hasHeadContent(Ap ap, Content c) { getHeadContent(ap) = c }
1493+
14901494
pragma[nomagic]
14911495
private predicate fwdFlowRead(
14921496
Ap ap, Content c, NodeEx node1, NodeEx node2, FlowState state, Cc cc,
14931497
ParamNodeOption summaryCtx, ApOption argAp, Configuration config
14941498
) {
14951499
fwdFlowRead0(node1, state, cc, summaryCtx, argAp, ap, config) and
14961500
PrevStage::readStepCand(node1, c, node2, config) and
1497-
getHeadContent(ap) = c
1501+
hasHeadContent(ap, c)
14981502
}
14991503

15001504
pragma[nomagic]

cpp/ql/lib/experimental/semmle/code/cpp/ir/dataflow/internal/DataFlowImpl4.qll

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1487,14 +1487,18 @@ private module MkStage<StageSig PrevStage> {
14871487
PrevStage::readStepCand(node1, _, _, config)
14881488
}
14891489

1490+
bindingset[ap, c]
1491+
pragma[inline_late]
1492+
private predicate hasHeadContent(Ap ap, Content c) { getHeadContent(ap) = c }
1493+
14901494
pragma[nomagic]
14911495
private predicate fwdFlowRead(
14921496
Ap ap, Content c, NodeEx node1, NodeEx node2, FlowState state, Cc cc,
14931497
ParamNodeOption summaryCtx, ApOption argAp, Configuration config
14941498
) {
14951499
fwdFlowRead0(node1, state, cc, summaryCtx, argAp, ap, config) and
14961500
PrevStage::readStepCand(node1, c, node2, config) and
1497-
getHeadContent(ap) = c
1501+
hasHeadContent(ap, c)
14981502
}
14991503

15001504
pragma[nomagic]

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1487,14 +1487,18 @@ private module MkStage<StageSig PrevStage> {
14871487
PrevStage::readStepCand(node1, _, _, config)
14881488
}
14891489

1490+
bindingset[ap, c]
1491+
pragma[inline_late]
1492+
private predicate hasHeadContent(Ap ap, Content c) { getHeadContent(ap) = c }
1493+
14901494
pragma[nomagic]
14911495
private predicate fwdFlowRead(
14921496
Ap ap, Content c, NodeEx node1, NodeEx node2, FlowState state, Cc cc,
14931497
ParamNodeOption summaryCtx, ApOption argAp, Configuration config
14941498
) {
14951499
fwdFlowRead0(node1, state, cc, summaryCtx, argAp, ap, config) and
14961500
PrevStage::readStepCand(node1, c, node2, config) and
1497-
getHeadContent(ap) = c
1501+
hasHeadContent(ap, c)
14981502
}
14991503

15001504
pragma[nomagic]

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1487,14 +1487,18 @@ private module MkStage<StageSig PrevStage> {
14871487
PrevStage::readStepCand(node1, _, _, config)
14881488
}
14891489

1490+
bindingset[ap, c]
1491+
pragma[inline_late]
1492+
private predicate hasHeadContent(Ap ap, Content c) { getHeadContent(ap) = c }
1493+
14901494
pragma[nomagic]
14911495
private predicate fwdFlowRead(
14921496
Ap ap, Content c, NodeEx node1, NodeEx node2, FlowState state, Cc cc,
14931497
ParamNodeOption summaryCtx, ApOption argAp, Configuration config
14941498
) {
14951499
fwdFlowRead0(node1, state, cc, summaryCtx, argAp, ap, config) and
14961500
PrevStage::readStepCand(node1, c, node2, config) and
1497-
getHeadContent(ap) = c
1501+
hasHeadContent(ap, c)
14981502
}
14991503

15001504
pragma[nomagic]

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1487,14 +1487,18 @@ private module MkStage<StageSig PrevStage> {
14871487
PrevStage::readStepCand(node1, _, _, config)
14881488
}
14891489

1490+
bindingset[ap, c]
1491+
pragma[inline_late]
1492+
private predicate hasHeadContent(Ap ap, Content c) { getHeadContent(ap) = c }
1493+
14901494
pragma[nomagic]
14911495
private predicate fwdFlowRead(
14921496
Ap ap, Content c, NodeEx node1, NodeEx node2, FlowState state, Cc cc,
14931497
ParamNodeOption summaryCtx, ApOption argAp, Configuration config
14941498
) {
14951499
fwdFlowRead0(node1, state, cc, summaryCtx, argAp, ap, config) and
14961500
PrevStage::readStepCand(node1, c, node2, config) and
1497-
getHeadContent(ap) = c
1501+
hasHeadContent(ap, c)
14981502
}
14991503

15001504
pragma[nomagic]

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1487,14 +1487,18 @@ private module MkStage<StageSig PrevStage> {
14871487
PrevStage::readStepCand(node1, _, _, config)
14881488
}
14891489

1490+
bindingset[ap, c]
1491+
pragma[inline_late]
1492+
private predicate hasHeadContent(Ap ap, Content c) { getHeadContent(ap) = c }
1493+
14901494
pragma[nomagic]
14911495
private predicate fwdFlowRead(
14921496
Ap ap, Content c, NodeEx node1, NodeEx node2, FlowState state, Cc cc,
14931497
ParamNodeOption summaryCtx, ApOption argAp, Configuration config
14941498
) {
14951499
fwdFlowRead0(node1, state, cc, summaryCtx, argAp, ap, config) and
14961500
PrevStage::readStepCand(node1, c, node2, config) and
1497-
getHeadContent(ap) = c
1501+
hasHeadContent(ap, c)
14981502
}
14991503

15001504
pragma[nomagic]

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1487,14 +1487,18 @@ private module MkStage<StageSig PrevStage> {
14871487
PrevStage::readStepCand(node1, _, _, config)
14881488
}
14891489

1490+
bindingset[ap, c]
1491+
pragma[inline_late]
1492+
private predicate hasHeadContent(Ap ap, Content c) { getHeadContent(ap) = c }
1493+
14901494
pragma[nomagic]
14911495
private predicate fwdFlowRead(
14921496
Ap ap, Content c, NodeEx node1, NodeEx node2, FlowState state, Cc cc,
14931497
ParamNodeOption summaryCtx, ApOption argAp, Configuration config
14941498
) {
14951499
fwdFlowRead0(node1, state, cc, summaryCtx, argAp, ap, config) and
14961500
PrevStage::readStepCand(node1, c, node2, config) and
1497-
getHeadContent(ap) = c
1501+
hasHeadContent(ap, c)
14981502
}
14991503

15001504
pragma[nomagic]

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1487,14 +1487,18 @@ private module MkStage<StageSig PrevStage> {
14871487
PrevStage::readStepCand(node1, _, _, config)
14881488
}
14891489

1490+
bindingset[ap, c]
1491+
pragma[inline_late]
1492+
private predicate hasHeadContent(Ap ap, Content c) { getHeadContent(ap) = c }
1493+
14901494
pragma[nomagic]
14911495
private predicate fwdFlowRead(
14921496
Ap ap, Content c, NodeEx node1, NodeEx node2, FlowState state, Cc cc,
14931497
ParamNodeOption summaryCtx, ApOption argAp, Configuration config
14941498
) {
14951499
fwdFlowRead0(node1, state, cc, summaryCtx, argAp, ap, config) and
14961500
PrevStage::readStepCand(node1, c, node2, config) and
1497-
getHeadContent(ap) = c
1501+
hasHeadContent(ap, c)
14981502
}
14991503

15001504
pragma[nomagic]

0 commit comments

Comments
 (0)