Skip to content

Commit f9bfd96

Browse files
committed
C++: Address review comments
1 parent 35403d4 commit f9bfd96

File tree

3 files changed

+9
-12
lines changed

3 files changed

+9
-12
lines changed

cpp/ql/lib/semmle/code/cpp/ir/implementation/aliased_ssa/PrintIR.qll

+3-4
Original file line numberDiff line numberDiff line change
@@ -422,21 +422,20 @@ private int getSuccessorIndex(IRBlock pred, IRBlock succ) {
422422
* has the given `value`.
423423
*/
424424
query predicate edges(PrintableIRBlock pred, PrintableIRBlock succ, string key, string value) {
425-
exists(EdgeKind kind, IRBlock predBlock, IRBlock succBlock |
425+
exists(IRBlock predBlock, IRBlock succBlock |
426426
predBlock = pred.getBlock() and
427427
succBlock = succ.getBlock() and
428-
predBlock.getSuccessor(kind) = succBlock and
429428
(
430429
key = "semmle.label" and
431430
exists(string kinds |
432431
kinds =
433-
concat(EdgeKind k |
432+
strictconcat(EdgeKind k |
434433
predBlock.getSuccessor(k) = succBlock
435434
|
436435
k.toString(), "|" order by k.toString()
437436
)
438437
|
439-
if predBlock.getBackEdgeSuccessor(kind) = succBlock
438+
if predBlock.getBackEdgeSuccessor(_) = succBlock
440439
then value = kinds + " (back edge)"
441440
else value = kinds
442441
)

cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/PrintIR.qll

+3-4
Original file line numberDiff line numberDiff line change
@@ -422,21 +422,20 @@ private int getSuccessorIndex(IRBlock pred, IRBlock succ) {
422422
* has the given `value`.
423423
*/
424424
query predicate edges(PrintableIRBlock pred, PrintableIRBlock succ, string key, string value) {
425-
exists(EdgeKind kind, IRBlock predBlock, IRBlock succBlock |
425+
exists(IRBlock predBlock, IRBlock succBlock |
426426
predBlock = pred.getBlock() and
427427
succBlock = succ.getBlock() and
428-
predBlock.getSuccessor(kind) = succBlock and
429428
(
430429
key = "semmle.label" and
431430
exists(string kinds |
432431
kinds =
433-
concat(EdgeKind k |
432+
strictconcat(EdgeKind k |
434433
predBlock.getSuccessor(k) = succBlock
435434
|
436435
k.toString(), "|" order by k.toString()
437436
)
438437
|
439-
if predBlock.getBackEdgeSuccessor(kind) = succBlock
438+
if predBlock.getBackEdgeSuccessor(_) = succBlock
440439
then value = kinds + " (back edge)"
441440
else value = kinds
442441
)

cpp/ql/lib/semmle/code/cpp/ir/implementation/unaliased_ssa/PrintIR.qll

+3-4
Original file line numberDiff line numberDiff line change
@@ -422,21 +422,20 @@ private int getSuccessorIndex(IRBlock pred, IRBlock succ) {
422422
* has the given `value`.
423423
*/
424424
query predicate edges(PrintableIRBlock pred, PrintableIRBlock succ, string key, string value) {
425-
exists(EdgeKind kind, IRBlock predBlock, IRBlock succBlock |
425+
exists(IRBlock predBlock, IRBlock succBlock |
426426
predBlock = pred.getBlock() and
427427
succBlock = succ.getBlock() and
428-
predBlock.getSuccessor(kind) = succBlock and
429428
(
430429
key = "semmle.label" and
431430
exists(string kinds |
432431
kinds =
433-
concat(EdgeKind k |
432+
strictconcat(EdgeKind k |
434433
predBlock.getSuccessor(k) = succBlock
435434
|
436435
k.toString(), "|" order by k.toString()
437436
)
438437
|
439-
if predBlock.getBackEdgeSuccessor(kind) = succBlock
438+
if predBlock.getBackEdgeSuccessor(_) = succBlock
440439
then value = kinds + " (back edge)"
441440
else value = kinds
442441
)

0 commit comments

Comments
 (0)