Skip to content

Commit 990e07b

Browse files
committed
Ruby/C#: add semmle.order attribute to edges in CFG tests
1 parent 5503abc commit 990e07b

File tree

4 files changed

+192
-162
lines changed

4 files changed

+192
-162
lines changed

csharp/ql/lib/semmle/code/csharp/controlflow/internal/ControlFlowGraphImplShared.qll

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -900,10 +900,25 @@ module TestOutput {
900900
}
901901

902902
query predicate edges(RelevantNode pred, RelevantNode succ, string attr, string val) {
903+
attr = "semmle.label" and
903904
exists(SuccessorType t | succ = getASuccessor(pred, t) |
904-
attr = "semmle.label" and
905905
if successorTypeIsSimple(t) then val = "" else val = t.toString()
906906
)
907+
or
908+
attr = "semmle.order" and
909+
val =
910+
any(int i |
911+
succ =
912+
rank[i](RelevantNode s, SuccessorType t, Location l |
913+
s = getASuccessor(pred, t) and
914+
l = s.getLocation()
915+
|
916+
s
917+
order by
918+
l.getFile().getBaseName(), l.getFile().getAbsolutePath(), l.getStartLine(),
919+
l.getStartColumn(), l.getEndLine(), l.getEndColumn(), t.toString()
920+
)
921+
).toString()
907922
}
908923
}
909924

0 commit comments

Comments
 (0)