Skip to content

Commit a772b82

Browse files
committed
Address review comments
1 parent a695b56 commit a772b82

File tree

19 files changed

+171
-209
lines changed

19 files changed

+171
-209
lines changed

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

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -422,13 +422,13 @@ private predicate nodeCand1_0(Node node, boolean toReturn, Configuration config)
422422
or
423423
exists(Node mid |
424424
jumpStep(node, mid, config) and
425-
nodeCand1(mid, config) and
425+
nodeCand1(mid, _, config) and
426426
toReturn = false
427427
)
428428
or
429429
exists(Node mid |
430430
additionalJumpStep(node, mid, config) and
431-
nodeCand1(mid, config) and
431+
nodeCand1(mid, _, config) and
432432
toReturn = false
433433
)
434434
or
@@ -447,10 +447,10 @@ private predicate nodeCand1_0(Node node, boolean toReturn, Configuration config)
447447
or
448448
// flow into a callable
449449
exists(DataFlowCall call |
450-
nodeCand1ParamArg(call, node, false, config) and
450+
nodeCand1Arg(call, node, false, config) and
451451
toReturn = false
452452
or
453-
nodeCand1ParamArgToReturn(call, node, config) and
453+
nodeCand1ArgToReturn(call, node, config) and
454454
flowInCand1(call, toReturn, config)
455455
)
456456
or
@@ -468,7 +468,7 @@ private predicate nodeCand1(Node node, Configuration config) { nodeCand1(node, _
468468
pragma[nomagic]
469469
private predicate nodeCand1ReturnPosition(ReturnPosition pos, Configuration config) {
470470
exists(DataFlowCall call, ReturnKindExt kind, Node out |
471-
nodeCand1(out, config) and
471+
nodeCand1(out, _, config) and
472472
pos = viableReturnPos(call, kind) and
473473
out = kind.getAnOutNode(call)
474474
)
@@ -484,7 +484,7 @@ private predicate readCand1(Content f, Configuration config) {
484484
nodeCandFwd1(node, unbind(config)) and
485485
readDirect(node, f, mid) and
486486
storeCandFwd1(f, unbind(config)) and
487-
nodeCand1(mid, config)
487+
nodeCand1(mid, _, config)
488488
)
489489
}
490490

@@ -515,7 +515,7 @@ private predicate viableParamArgCandFwd1(
515515
}
516516

517517
pragma[nomagic]
518-
private predicate nodeCand1ParamArg(
518+
private predicate nodeCand1Arg(
519519
DataFlowCall call, ArgumentNode arg, boolean toReturn, Configuration config
520520
) {
521521
exists(ParameterNode p |
@@ -525,10 +525,8 @@ private predicate nodeCand1ParamArg(
525525
}
526526

527527
pragma[nomagic]
528-
private predicate nodeCand1ParamArgToReturn(
529-
DataFlowCall call, ArgumentNode arg, Configuration config
530-
) {
531-
nodeCand1ParamArg(call, arg, true, config)
528+
private predicate nodeCand1ArgToReturn(DataFlowCall call, ArgumentNode arg, Configuration config) {
529+
nodeCand1Arg(call, arg, true, config)
532530
}
533531

534532
/**

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

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -422,13 +422,13 @@ private predicate nodeCand1_0(Node node, boolean toReturn, Configuration config)
422422
or
423423
exists(Node mid |
424424
jumpStep(node, mid, config) and
425-
nodeCand1(mid, config) and
425+
nodeCand1(mid, _, config) and
426426
toReturn = false
427427
)
428428
or
429429
exists(Node mid |
430430
additionalJumpStep(node, mid, config) and
431-
nodeCand1(mid, config) and
431+
nodeCand1(mid, _, config) and
432432
toReturn = false
433433
)
434434
or
@@ -447,10 +447,10 @@ private predicate nodeCand1_0(Node node, boolean toReturn, Configuration config)
447447
or
448448
// flow into a callable
449449
exists(DataFlowCall call |
450-
nodeCand1ParamArg(call, node, false, config) and
450+
nodeCand1Arg(call, node, false, config) and
451451
toReturn = false
452452
or
453-
nodeCand1ParamArgToReturn(call, node, config) and
453+
nodeCand1ArgToReturn(call, node, config) and
454454
flowInCand1(call, toReturn, config)
455455
)
456456
or
@@ -468,7 +468,7 @@ private predicate nodeCand1(Node node, Configuration config) { nodeCand1(node, _
468468
pragma[nomagic]
469469
private predicate nodeCand1ReturnPosition(ReturnPosition pos, Configuration config) {
470470
exists(DataFlowCall call, ReturnKindExt kind, Node out |
471-
nodeCand1(out, config) and
471+
nodeCand1(out, _, config) and
472472
pos = viableReturnPos(call, kind) and
473473
out = kind.getAnOutNode(call)
474474
)
@@ -484,7 +484,7 @@ private predicate readCand1(Content f, Configuration config) {
484484
nodeCandFwd1(node, unbind(config)) and
485485
readDirect(node, f, mid) and
486486
storeCandFwd1(f, unbind(config)) and
487-
nodeCand1(mid, config)
487+
nodeCand1(mid, _, config)
488488
)
489489
}
490490

@@ -515,7 +515,7 @@ private predicate viableParamArgCandFwd1(
515515
}
516516

517517
pragma[nomagic]
518-
private predicate nodeCand1ParamArg(
518+
private predicate nodeCand1Arg(
519519
DataFlowCall call, ArgumentNode arg, boolean toReturn, Configuration config
520520
) {
521521
exists(ParameterNode p |
@@ -525,10 +525,8 @@ private predicate nodeCand1ParamArg(
525525
}
526526

527527
pragma[nomagic]
528-
private predicate nodeCand1ParamArgToReturn(
529-
DataFlowCall call, ArgumentNode arg, Configuration config
530-
) {
531-
nodeCand1ParamArg(call, arg, true, config)
528+
private predicate nodeCand1ArgToReturn(DataFlowCall call, ArgumentNode arg, Configuration config) {
529+
nodeCand1Arg(call, arg, true, config)
532530
}
533531

534532
/**

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

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -422,13 +422,13 @@ private predicate nodeCand1_0(Node node, boolean toReturn, Configuration config)
422422
or
423423
exists(Node mid |
424424
jumpStep(node, mid, config) and
425-
nodeCand1(mid, config) and
425+
nodeCand1(mid, _, config) and
426426
toReturn = false
427427
)
428428
or
429429
exists(Node mid |
430430
additionalJumpStep(node, mid, config) and
431-
nodeCand1(mid, config) and
431+
nodeCand1(mid, _, config) and
432432
toReturn = false
433433
)
434434
or
@@ -447,10 +447,10 @@ private predicate nodeCand1_0(Node node, boolean toReturn, Configuration config)
447447
or
448448
// flow into a callable
449449
exists(DataFlowCall call |
450-
nodeCand1ParamArg(call, node, false, config) and
450+
nodeCand1Arg(call, node, false, config) and
451451
toReturn = false
452452
or
453-
nodeCand1ParamArgToReturn(call, node, config) and
453+
nodeCand1ArgToReturn(call, node, config) and
454454
flowInCand1(call, toReturn, config)
455455
)
456456
or
@@ -468,7 +468,7 @@ private predicate nodeCand1(Node node, Configuration config) { nodeCand1(node, _
468468
pragma[nomagic]
469469
private predicate nodeCand1ReturnPosition(ReturnPosition pos, Configuration config) {
470470
exists(DataFlowCall call, ReturnKindExt kind, Node out |
471-
nodeCand1(out, config) and
471+
nodeCand1(out, _, config) and
472472
pos = viableReturnPos(call, kind) and
473473
out = kind.getAnOutNode(call)
474474
)
@@ -484,7 +484,7 @@ private predicate readCand1(Content f, Configuration config) {
484484
nodeCandFwd1(node, unbind(config)) and
485485
readDirect(node, f, mid) and
486486
storeCandFwd1(f, unbind(config)) and
487-
nodeCand1(mid, config)
487+
nodeCand1(mid, _, config)
488488
)
489489
}
490490

@@ -515,7 +515,7 @@ private predicate viableParamArgCandFwd1(
515515
}
516516

517517
pragma[nomagic]
518-
private predicate nodeCand1ParamArg(
518+
private predicate nodeCand1Arg(
519519
DataFlowCall call, ArgumentNode arg, boolean toReturn, Configuration config
520520
) {
521521
exists(ParameterNode p |
@@ -525,10 +525,8 @@ private predicate nodeCand1ParamArg(
525525
}
526526

527527
pragma[nomagic]
528-
private predicate nodeCand1ParamArgToReturn(
529-
DataFlowCall call, ArgumentNode arg, Configuration config
530-
) {
531-
nodeCand1ParamArg(call, arg, true, config)
528+
private predicate nodeCand1ArgToReturn(DataFlowCall call, ArgumentNode arg, Configuration config) {
529+
nodeCand1Arg(call, arg, true, config)
532530
}
533531

534532
/**

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

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -422,13 +422,13 @@ private predicate nodeCand1_0(Node node, boolean toReturn, Configuration config)
422422
or
423423
exists(Node mid |
424424
jumpStep(node, mid, config) and
425-
nodeCand1(mid, config) and
425+
nodeCand1(mid, _, config) and
426426
toReturn = false
427427
)
428428
or
429429
exists(Node mid |
430430
additionalJumpStep(node, mid, config) and
431-
nodeCand1(mid, config) and
431+
nodeCand1(mid, _, config) and
432432
toReturn = false
433433
)
434434
or
@@ -447,10 +447,10 @@ private predicate nodeCand1_0(Node node, boolean toReturn, Configuration config)
447447
or
448448
// flow into a callable
449449
exists(DataFlowCall call |
450-
nodeCand1ParamArg(call, node, false, config) and
450+
nodeCand1Arg(call, node, false, config) and
451451
toReturn = false
452452
or
453-
nodeCand1ParamArgToReturn(call, node, config) and
453+
nodeCand1ArgToReturn(call, node, config) and
454454
flowInCand1(call, toReturn, config)
455455
)
456456
or
@@ -468,7 +468,7 @@ private predicate nodeCand1(Node node, Configuration config) { nodeCand1(node, _
468468
pragma[nomagic]
469469
private predicate nodeCand1ReturnPosition(ReturnPosition pos, Configuration config) {
470470
exists(DataFlowCall call, ReturnKindExt kind, Node out |
471-
nodeCand1(out, config) and
471+
nodeCand1(out, _, config) and
472472
pos = viableReturnPos(call, kind) and
473473
out = kind.getAnOutNode(call)
474474
)
@@ -484,7 +484,7 @@ private predicate readCand1(Content f, Configuration config) {
484484
nodeCandFwd1(node, unbind(config)) and
485485
readDirect(node, f, mid) and
486486
storeCandFwd1(f, unbind(config)) and
487-
nodeCand1(mid, config)
487+
nodeCand1(mid, _, config)
488488
)
489489
}
490490

@@ -515,7 +515,7 @@ private predicate viableParamArgCandFwd1(
515515
}
516516

517517
pragma[nomagic]
518-
private predicate nodeCand1ParamArg(
518+
private predicate nodeCand1Arg(
519519
DataFlowCall call, ArgumentNode arg, boolean toReturn, Configuration config
520520
) {
521521
exists(ParameterNode p |
@@ -525,10 +525,8 @@ private predicate nodeCand1ParamArg(
525525
}
526526

527527
pragma[nomagic]
528-
private predicate nodeCand1ParamArgToReturn(
529-
DataFlowCall call, ArgumentNode arg, Configuration config
530-
) {
531-
nodeCand1ParamArg(call, arg, true, config)
528+
private predicate nodeCand1ArgToReturn(DataFlowCall call, ArgumentNode arg, Configuration config) {
529+
nodeCand1Arg(call, arg, true, config)
532530
}
533531

534532
/**

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

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -422,13 +422,13 @@ private predicate nodeCand1_0(Node node, boolean toReturn, Configuration config)
422422
or
423423
exists(Node mid |
424424
jumpStep(node, mid, config) and
425-
nodeCand1(mid, config) and
425+
nodeCand1(mid, _, config) and
426426
toReturn = false
427427
)
428428
or
429429
exists(Node mid |
430430
additionalJumpStep(node, mid, config) and
431-
nodeCand1(mid, config) and
431+
nodeCand1(mid, _, config) and
432432
toReturn = false
433433
)
434434
or
@@ -447,10 +447,10 @@ private predicate nodeCand1_0(Node node, boolean toReturn, Configuration config)
447447
or
448448
// flow into a callable
449449
exists(DataFlowCall call |
450-
nodeCand1ParamArg(call, node, false, config) and
450+
nodeCand1Arg(call, node, false, config) and
451451
toReturn = false
452452
or
453-
nodeCand1ParamArgToReturn(call, node, config) and
453+
nodeCand1ArgToReturn(call, node, config) and
454454
flowInCand1(call, toReturn, config)
455455
)
456456
or
@@ -468,7 +468,7 @@ private predicate nodeCand1(Node node, Configuration config) { nodeCand1(node, _
468468
pragma[nomagic]
469469
private predicate nodeCand1ReturnPosition(ReturnPosition pos, Configuration config) {
470470
exists(DataFlowCall call, ReturnKindExt kind, Node out |
471-
nodeCand1(out, config) and
471+
nodeCand1(out, _, config) and
472472
pos = viableReturnPos(call, kind) and
473473
out = kind.getAnOutNode(call)
474474
)
@@ -484,7 +484,7 @@ private predicate readCand1(Content f, Configuration config) {
484484
nodeCandFwd1(node, unbind(config)) and
485485
readDirect(node, f, mid) and
486486
storeCandFwd1(f, unbind(config)) and
487-
nodeCand1(mid, config)
487+
nodeCand1(mid, _, config)
488488
)
489489
}
490490

@@ -515,7 +515,7 @@ private predicate viableParamArgCandFwd1(
515515
}
516516

517517
pragma[nomagic]
518-
private predicate nodeCand1ParamArg(
518+
private predicate nodeCand1Arg(
519519
DataFlowCall call, ArgumentNode arg, boolean toReturn, Configuration config
520520
) {
521521
exists(ParameterNode p |
@@ -525,10 +525,8 @@ private predicate nodeCand1ParamArg(
525525
}
526526

527527
pragma[nomagic]
528-
private predicate nodeCand1ParamArgToReturn(
529-
DataFlowCall call, ArgumentNode arg, Configuration config
530-
) {
531-
nodeCand1ParamArg(call, arg, true, config)
528+
private predicate nodeCand1ArgToReturn(DataFlowCall call, ArgumentNode arg, Configuration config) {
529+
nodeCand1Arg(call, arg, true, config)
532530
}
533531

534532
/**

0 commit comments

Comments
 (0)