Skip to content

Commit e9c8f97

Browse files
committed
Data flow: Sync files
1 parent 2b4fde7 commit e9c8f97

28 files changed

+616
-476
lines changed

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

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4206,10 +4206,11 @@ private module Subpaths {
42064206
pragma[nomagic]
42074207
private predicate subpaths01(
42084208
PathNodeImpl arg, ParamNodeEx par, SummaryCtxSome sc, CallContext innercc, ReturnKindExt kind,
4209-
NodeEx out, FlowState sout, AccessPath apout
4209+
NodeEx out, FlowState sout, CallContext ccout, AccessPath apout
42104210
) {
42114211
exists(Configuration config |
4212-
pathThroughCallable(arg, out, pragma[only_bind_into](sout), _, pragma[only_bind_into](apout)) and
4212+
pathThroughCallable(arg, out, pragma[only_bind_into](sout), ccout,
4213+
pragma[only_bind_into](apout)) and
42134214
pathIntoCallable(arg, par, _, _, innercc, sc, _, config) and
42144215
paramFlowsThrough(kind, pragma[only_bind_into](sout), innercc, sc,
42154216
pragma[only_bind_into](apout), _, unbindConf(config)) and
@@ -4224,10 +4225,11 @@ private module Subpaths {
42244225
pragma[nomagic]
42254226
private predicate subpaths02(
42264227
PathNode arg, ParamNodeEx par, SummaryCtxSome sc, CallContext innercc, ReturnKindExt kind,
4227-
NodeEx out, FlowState sout, AccessPath apout
4228+
NodeEx out, FlowState sout, CallContext ccout, AccessPath apout, Configuration config
42284229
) {
4229-
subpaths01(arg, par, sc, innercc, kind, out, sout, apout) and
4230-
out.asNode() = kind.getAnOutNode(_)
4230+
subpaths01(arg, par, sc, innercc, kind, out, sout, ccout, apout) and
4231+
out.asNode() = kind.getAnOutNode(_) and
4232+
config = getPathNodeConf(arg)
42314233
}
42324234

42334235
pragma[nomagic]
@@ -4238,12 +4240,14 @@ private module Subpaths {
42384240
*/
42394241
pragma[nomagic]
42404242
private predicate subpaths03(
4241-
PathNode arg, ParamNodeEx par, PathNodeMid ret, NodeEx out, FlowState sout, AccessPath apout
4243+
PathNodeMid arg, ParamNodeEx par, PathNodeMid ret, NodeEx out, FlowState sout,
4244+
CallContext ccout, AccessPath apout, SummaryCtx scout, Configuration config
42424245
) {
42434246
exists(SummaryCtxSome sc, CallContext innercc, ReturnKindExt kind, RetNodeEx retnode |
4244-
subpaths02(arg, par, sc, innercc, kind, out, sout, apout) and
4245-
pathNode(ret, retnode, sout, innercc, sc, apout, unbindConf(getPathNodeConf(arg)), _) and
4246-
kind = retnode.getKind()
4247+
subpaths02(arg, par, sc, innercc, kind, out, sout, ccout, apout, config) and
4248+
pathNode(ret, retnode, sout, innercc, sc, apout, config, _) and
4249+
kind = retnode.getKind() and
4250+
scout = arg.getSummaryCtx()
42474251
)
42484252
}
42494253

@@ -4263,16 +4267,17 @@ private module Subpaths {
42634267
* `ret -> out` is summarized as the edge `arg -> out`.
42644268
*/
42654269
predicate subpaths(PathNode arg, PathNodeImpl par, PathNodeImpl ret, PathNode out) {
4266-
exists(ParamNodeEx p, NodeEx o, FlowState sout, AccessPath apout, PathNodeMid out0 |
4270+
exists(
4271+
ParamNodeEx p, NodeEx o, FlowState sout, AccessPath apout, CallContext ccout,
4272+
SummaryCtx scout, PathNodeMid out0, Configuration config
4273+
|
42674274
pragma[only_bind_into](arg).getASuccessor() = par and
4268-
pragma[only_bind_into](arg).getASuccessor() = out0 and
4269-
subpaths03(arg, p, localStepToHidden*(ret), o, sout, apout) and
4275+
subpaths03(arg, p, localStepToHidden*(ret), o, sout, ccout, apout, scout, config) and
4276+
pathNode(out0, o, sout, ccout, scout, apout, config, _) and
42704277
not ret.isHidden() and
4271-
par.getNodeEx() = p and
4272-
out0.getNodeEx() = o and
4273-
out0.getState() = sout and
4274-
out0.getAp() = apout and
4275-
(out = out0 or out = out0.projectToSink())
4278+
par.getNodeEx() = p
4279+
|
4280+
out = out0 or out = out0.projectToSink()
42764281
)
42774282
}
42784283

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

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4206,10 +4206,11 @@ private module Subpaths {
42064206
pragma[nomagic]
42074207
private predicate subpaths01(
42084208
PathNodeImpl arg, ParamNodeEx par, SummaryCtxSome sc, CallContext innercc, ReturnKindExt kind,
4209-
NodeEx out, FlowState sout, AccessPath apout
4209+
NodeEx out, FlowState sout, CallContext ccout, AccessPath apout
42104210
) {
42114211
exists(Configuration config |
4212-
pathThroughCallable(arg, out, pragma[only_bind_into](sout), _, pragma[only_bind_into](apout)) and
4212+
pathThroughCallable(arg, out, pragma[only_bind_into](sout), ccout,
4213+
pragma[only_bind_into](apout)) and
42134214
pathIntoCallable(arg, par, _, _, innercc, sc, _, config) and
42144215
paramFlowsThrough(kind, pragma[only_bind_into](sout), innercc, sc,
42154216
pragma[only_bind_into](apout), _, unbindConf(config)) and
@@ -4224,10 +4225,11 @@ private module Subpaths {
42244225
pragma[nomagic]
42254226
private predicate subpaths02(
42264227
PathNode arg, ParamNodeEx par, SummaryCtxSome sc, CallContext innercc, ReturnKindExt kind,
4227-
NodeEx out, FlowState sout, AccessPath apout
4228+
NodeEx out, FlowState sout, CallContext ccout, AccessPath apout, Configuration config
42284229
) {
4229-
subpaths01(arg, par, sc, innercc, kind, out, sout, apout) and
4230-
out.asNode() = kind.getAnOutNode(_)
4230+
subpaths01(arg, par, sc, innercc, kind, out, sout, ccout, apout) and
4231+
out.asNode() = kind.getAnOutNode(_) and
4232+
config = getPathNodeConf(arg)
42314233
}
42324234

42334235
pragma[nomagic]
@@ -4238,12 +4240,14 @@ private module Subpaths {
42384240
*/
42394241
pragma[nomagic]
42404242
private predicate subpaths03(
4241-
PathNode arg, ParamNodeEx par, PathNodeMid ret, NodeEx out, FlowState sout, AccessPath apout
4243+
PathNodeMid arg, ParamNodeEx par, PathNodeMid ret, NodeEx out, FlowState sout,
4244+
CallContext ccout, AccessPath apout, SummaryCtx scout, Configuration config
42424245
) {
42434246
exists(SummaryCtxSome sc, CallContext innercc, ReturnKindExt kind, RetNodeEx retnode |
4244-
subpaths02(arg, par, sc, innercc, kind, out, sout, apout) and
4245-
pathNode(ret, retnode, sout, innercc, sc, apout, unbindConf(getPathNodeConf(arg)), _) and
4246-
kind = retnode.getKind()
4247+
subpaths02(arg, par, sc, innercc, kind, out, sout, ccout, apout, config) and
4248+
pathNode(ret, retnode, sout, innercc, sc, apout, config, _) and
4249+
kind = retnode.getKind() and
4250+
scout = arg.getSummaryCtx()
42474251
)
42484252
}
42494253

@@ -4263,16 +4267,17 @@ private module Subpaths {
42634267
* `ret -> out` is summarized as the edge `arg -> out`.
42644268
*/
42654269
predicate subpaths(PathNode arg, PathNodeImpl par, PathNodeImpl ret, PathNode out) {
4266-
exists(ParamNodeEx p, NodeEx o, FlowState sout, AccessPath apout, PathNodeMid out0 |
4270+
exists(
4271+
ParamNodeEx p, NodeEx o, FlowState sout, AccessPath apout, CallContext ccout,
4272+
SummaryCtx scout, PathNodeMid out0, Configuration config
4273+
|
42674274
pragma[only_bind_into](arg).getASuccessor() = par and
4268-
pragma[only_bind_into](arg).getASuccessor() = out0 and
4269-
subpaths03(arg, p, localStepToHidden*(ret), o, sout, apout) and
4275+
subpaths03(arg, p, localStepToHidden*(ret), o, sout, ccout, apout, scout, config) and
4276+
pathNode(out0, o, sout, ccout, scout, apout, config, _) and
42704277
not ret.isHidden() and
4271-
par.getNodeEx() = p and
4272-
out0.getNodeEx() = o and
4273-
out0.getState() = sout and
4274-
out0.getAp() = apout and
4275-
(out = out0 or out = out0.projectToSink())
4278+
par.getNodeEx() = p
4279+
|
4280+
out = out0 or out = out0.projectToSink()
42764281
)
42774282
}
42784283

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

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4206,10 +4206,11 @@ private module Subpaths {
42064206
pragma[nomagic]
42074207
private predicate subpaths01(
42084208
PathNodeImpl arg, ParamNodeEx par, SummaryCtxSome sc, CallContext innercc, ReturnKindExt kind,
4209-
NodeEx out, FlowState sout, AccessPath apout
4209+
NodeEx out, FlowState sout, CallContext ccout, AccessPath apout
42104210
) {
42114211
exists(Configuration config |
4212-
pathThroughCallable(arg, out, pragma[only_bind_into](sout), _, pragma[only_bind_into](apout)) and
4212+
pathThroughCallable(arg, out, pragma[only_bind_into](sout), ccout,
4213+
pragma[only_bind_into](apout)) and
42134214
pathIntoCallable(arg, par, _, _, innercc, sc, _, config) and
42144215
paramFlowsThrough(kind, pragma[only_bind_into](sout), innercc, sc,
42154216
pragma[only_bind_into](apout), _, unbindConf(config)) and
@@ -4224,10 +4225,11 @@ private module Subpaths {
42244225
pragma[nomagic]
42254226
private predicate subpaths02(
42264227
PathNode arg, ParamNodeEx par, SummaryCtxSome sc, CallContext innercc, ReturnKindExt kind,
4227-
NodeEx out, FlowState sout, AccessPath apout
4228+
NodeEx out, FlowState sout, CallContext ccout, AccessPath apout, Configuration config
42284229
) {
4229-
subpaths01(arg, par, sc, innercc, kind, out, sout, apout) and
4230-
out.asNode() = kind.getAnOutNode(_)
4230+
subpaths01(arg, par, sc, innercc, kind, out, sout, ccout, apout) and
4231+
out.asNode() = kind.getAnOutNode(_) and
4232+
config = getPathNodeConf(arg)
42314233
}
42324234

42334235
pragma[nomagic]
@@ -4238,12 +4240,14 @@ private module Subpaths {
42384240
*/
42394241
pragma[nomagic]
42404242
private predicate subpaths03(
4241-
PathNode arg, ParamNodeEx par, PathNodeMid ret, NodeEx out, FlowState sout, AccessPath apout
4243+
PathNodeMid arg, ParamNodeEx par, PathNodeMid ret, NodeEx out, FlowState sout,
4244+
CallContext ccout, AccessPath apout, SummaryCtx scout, Configuration config
42424245
) {
42434246
exists(SummaryCtxSome sc, CallContext innercc, ReturnKindExt kind, RetNodeEx retnode |
4244-
subpaths02(arg, par, sc, innercc, kind, out, sout, apout) and
4245-
pathNode(ret, retnode, sout, innercc, sc, apout, unbindConf(getPathNodeConf(arg)), _) and
4246-
kind = retnode.getKind()
4247+
subpaths02(arg, par, sc, innercc, kind, out, sout, ccout, apout, config) and
4248+
pathNode(ret, retnode, sout, innercc, sc, apout, config, _) and
4249+
kind = retnode.getKind() and
4250+
scout = arg.getSummaryCtx()
42474251
)
42484252
}
42494253

@@ -4263,16 +4267,17 @@ private module Subpaths {
42634267
* `ret -> out` is summarized as the edge `arg -> out`.
42644268
*/
42654269
predicate subpaths(PathNode arg, PathNodeImpl par, PathNodeImpl ret, PathNode out) {
4266-
exists(ParamNodeEx p, NodeEx o, FlowState sout, AccessPath apout, PathNodeMid out0 |
4270+
exists(
4271+
ParamNodeEx p, NodeEx o, FlowState sout, AccessPath apout, CallContext ccout,
4272+
SummaryCtx scout, PathNodeMid out0, Configuration config
4273+
|
42674274
pragma[only_bind_into](arg).getASuccessor() = par and
4268-
pragma[only_bind_into](arg).getASuccessor() = out0 and
4269-
subpaths03(arg, p, localStepToHidden*(ret), o, sout, apout) and
4275+
subpaths03(arg, p, localStepToHidden*(ret), o, sout, ccout, apout, scout, config) and
4276+
pathNode(out0, o, sout, ccout, scout, apout, config, _) and
42704277
not ret.isHidden() and
4271-
par.getNodeEx() = p and
4272-
out0.getNodeEx() = o and
4273-
out0.getState() = sout and
4274-
out0.getAp() = apout and
4275-
(out = out0 or out = out0.projectToSink())
4278+
par.getNodeEx() = p
4279+
|
4280+
out = out0 or out = out0.projectToSink()
42764281
)
42774282
}
42784283

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

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4206,10 +4206,11 @@ private module Subpaths {
42064206
pragma[nomagic]
42074207
private predicate subpaths01(
42084208
PathNodeImpl arg, ParamNodeEx par, SummaryCtxSome sc, CallContext innercc, ReturnKindExt kind,
4209-
NodeEx out, FlowState sout, AccessPath apout
4209+
NodeEx out, FlowState sout, CallContext ccout, AccessPath apout
42104210
) {
42114211
exists(Configuration config |
4212-
pathThroughCallable(arg, out, pragma[only_bind_into](sout), _, pragma[only_bind_into](apout)) and
4212+
pathThroughCallable(arg, out, pragma[only_bind_into](sout), ccout,
4213+
pragma[only_bind_into](apout)) and
42134214
pathIntoCallable(arg, par, _, _, innercc, sc, _, config) and
42144215
paramFlowsThrough(kind, pragma[only_bind_into](sout), innercc, sc,
42154216
pragma[only_bind_into](apout), _, unbindConf(config)) and
@@ -4224,10 +4225,11 @@ private module Subpaths {
42244225
pragma[nomagic]
42254226
private predicate subpaths02(
42264227
PathNode arg, ParamNodeEx par, SummaryCtxSome sc, CallContext innercc, ReturnKindExt kind,
4227-
NodeEx out, FlowState sout, AccessPath apout
4228+
NodeEx out, FlowState sout, CallContext ccout, AccessPath apout, Configuration config
42284229
) {
4229-
subpaths01(arg, par, sc, innercc, kind, out, sout, apout) and
4230-
out.asNode() = kind.getAnOutNode(_)
4230+
subpaths01(arg, par, sc, innercc, kind, out, sout, ccout, apout) and
4231+
out.asNode() = kind.getAnOutNode(_) and
4232+
config = getPathNodeConf(arg)
42314233
}
42324234

42334235
pragma[nomagic]
@@ -4238,12 +4240,14 @@ private module Subpaths {
42384240
*/
42394241
pragma[nomagic]
42404242
private predicate subpaths03(
4241-
PathNode arg, ParamNodeEx par, PathNodeMid ret, NodeEx out, FlowState sout, AccessPath apout
4243+
PathNodeMid arg, ParamNodeEx par, PathNodeMid ret, NodeEx out, FlowState sout,
4244+
CallContext ccout, AccessPath apout, SummaryCtx scout, Configuration config
42424245
) {
42434246
exists(SummaryCtxSome sc, CallContext innercc, ReturnKindExt kind, RetNodeEx retnode |
4244-
subpaths02(arg, par, sc, innercc, kind, out, sout, apout) and
4245-
pathNode(ret, retnode, sout, innercc, sc, apout, unbindConf(getPathNodeConf(arg)), _) and
4246-
kind = retnode.getKind()
4247+
subpaths02(arg, par, sc, innercc, kind, out, sout, ccout, apout, config) and
4248+
pathNode(ret, retnode, sout, innercc, sc, apout, config, _) and
4249+
kind = retnode.getKind() and
4250+
scout = arg.getSummaryCtx()
42474251
)
42484252
}
42494253

@@ -4263,16 +4267,17 @@ private module Subpaths {
42634267
* `ret -> out` is summarized as the edge `arg -> out`.
42644268
*/
42654269
predicate subpaths(PathNode arg, PathNodeImpl par, PathNodeImpl ret, PathNode out) {
4266-
exists(ParamNodeEx p, NodeEx o, FlowState sout, AccessPath apout, PathNodeMid out0 |
4270+
exists(
4271+
ParamNodeEx p, NodeEx o, FlowState sout, AccessPath apout, CallContext ccout,
4272+
SummaryCtx scout, PathNodeMid out0, Configuration config
4273+
|
42674274
pragma[only_bind_into](arg).getASuccessor() = par and
4268-
pragma[only_bind_into](arg).getASuccessor() = out0 and
4269-
subpaths03(arg, p, localStepToHidden*(ret), o, sout, apout) and
4275+
subpaths03(arg, p, localStepToHidden*(ret), o, sout, ccout, apout, scout, config) and
4276+
pathNode(out0, o, sout, ccout, scout, apout, config, _) and
42704277
not ret.isHidden() and
4271-
par.getNodeEx() = p and
4272-
out0.getNodeEx() = o and
4273-
out0.getState() = sout and
4274-
out0.getAp() = apout and
4275-
(out = out0 or out = out0.projectToSink())
4278+
par.getNodeEx() = p
4279+
|
4280+
out = out0 or out = out0.projectToSink()
42764281
)
42774282
}
42784283

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

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4206,10 +4206,11 @@ private module Subpaths {
42064206
pragma[nomagic]
42074207
private predicate subpaths01(
42084208
PathNodeImpl arg, ParamNodeEx par, SummaryCtxSome sc, CallContext innercc, ReturnKindExt kind,
4209-
NodeEx out, FlowState sout, AccessPath apout
4209+
NodeEx out, FlowState sout, CallContext ccout, AccessPath apout
42104210
) {
42114211
exists(Configuration config |
4212-
pathThroughCallable(arg, out, pragma[only_bind_into](sout), _, pragma[only_bind_into](apout)) and
4212+
pathThroughCallable(arg, out, pragma[only_bind_into](sout), ccout,
4213+
pragma[only_bind_into](apout)) and
42134214
pathIntoCallable(arg, par, _, _, innercc, sc, _, config) and
42144215
paramFlowsThrough(kind, pragma[only_bind_into](sout), innercc, sc,
42154216
pragma[only_bind_into](apout), _, unbindConf(config)) and
@@ -4224,10 +4225,11 @@ private module Subpaths {
42244225
pragma[nomagic]
42254226
private predicate subpaths02(
42264227
PathNode arg, ParamNodeEx par, SummaryCtxSome sc, CallContext innercc, ReturnKindExt kind,
4227-
NodeEx out, FlowState sout, AccessPath apout
4228+
NodeEx out, FlowState sout, CallContext ccout, AccessPath apout, Configuration config
42284229
) {
4229-
subpaths01(arg, par, sc, innercc, kind, out, sout, apout) and
4230-
out.asNode() = kind.getAnOutNode(_)
4230+
subpaths01(arg, par, sc, innercc, kind, out, sout, ccout, apout) and
4231+
out.asNode() = kind.getAnOutNode(_) and
4232+
config = getPathNodeConf(arg)
42314233
}
42324234

42334235
pragma[nomagic]
@@ -4238,12 +4240,14 @@ private module Subpaths {
42384240
*/
42394241
pragma[nomagic]
42404242
private predicate subpaths03(
4241-
PathNode arg, ParamNodeEx par, PathNodeMid ret, NodeEx out, FlowState sout, AccessPath apout
4243+
PathNodeMid arg, ParamNodeEx par, PathNodeMid ret, NodeEx out, FlowState sout,
4244+
CallContext ccout, AccessPath apout, SummaryCtx scout, Configuration config
42424245
) {
42434246
exists(SummaryCtxSome sc, CallContext innercc, ReturnKindExt kind, RetNodeEx retnode |
4244-
subpaths02(arg, par, sc, innercc, kind, out, sout, apout) and
4245-
pathNode(ret, retnode, sout, innercc, sc, apout, unbindConf(getPathNodeConf(arg)), _) and
4246-
kind = retnode.getKind()
4247+
subpaths02(arg, par, sc, innercc, kind, out, sout, ccout, apout, config) and
4248+
pathNode(ret, retnode, sout, innercc, sc, apout, config, _) and
4249+
kind = retnode.getKind() and
4250+
scout = arg.getSummaryCtx()
42474251
)
42484252
}
42494253

@@ -4263,16 +4267,17 @@ private module Subpaths {
42634267
* `ret -> out` is summarized as the edge `arg -> out`.
42644268
*/
42654269
predicate subpaths(PathNode arg, PathNodeImpl par, PathNodeImpl ret, PathNode out) {
4266-
exists(ParamNodeEx p, NodeEx o, FlowState sout, AccessPath apout, PathNodeMid out0 |
4270+
exists(
4271+
ParamNodeEx p, NodeEx o, FlowState sout, AccessPath apout, CallContext ccout,
4272+
SummaryCtx scout, PathNodeMid out0, Configuration config
4273+
|
42674274
pragma[only_bind_into](arg).getASuccessor() = par and
4268-
pragma[only_bind_into](arg).getASuccessor() = out0 and
4269-
subpaths03(arg, p, localStepToHidden*(ret), o, sout, apout) and
4275+
subpaths03(arg, p, localStepToHidden*(ret), o, sout, ccout, apout, scout, config) and
4276+
pathNode(out0, o, sout, ccout, scout, apout, config, _) and
42704277
not ret.isHidden() and
4271-
par.getNodeEx() = p and
4272-
out0.getNodeEx() = o and
4273-
out0.getState() = sout and
4274-
out0.getAp() = apout and
4275-
(out = out0 or out = out0.projectToSink())
4278+
par.getNodeEx() = p
4279+
|
4280+
out = out0 or out = out0.projectToSink()
42764281
)
42774282
}
42784283

0 commit comments

Comments
 (0)