Skip to content

Commit 8c9431d

Browse files
committed
CFG: Workaround in test output for source/sink pairs with multiple edges
1 parent a69524f commit 8c9431d

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

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

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -907,9 +907,13 @@ module TestOutput {
907907

908908
query predicate edges(RelevantNode pred, RelevantNode succ, string attr, string val) {
909909
attr = "semmle.label" and
910-
exists(SuccessorType t | succ = getASuccessor(pred, t) |
911-
if successorTypeIsSimple(t) then val = "" else val = t.toString()
912-
)
910+
val =
911+
strictconcat(SuccessorType t, string s |
912+
succ = getASuccessor(pred, t) and
913+
if successorTypeIsSimple(t) then s = "" else s = t.toString()
914+
|
915+
s, ", " order by s
916+
)
913917
or
914918
attr = "semmle.order" and
915919
val =

csharp/ql/test/library-tests/controlflow/graph/NodeGraph.expected

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2775,7 +2775,7 @@ Assert.cs:
27752775
#-----| true -> access to parameter b2
27762776

27772777
# 140| [assertion failure] access to parameter b2
2778-
#-----| false -> [assertion failure] access to parameter b3
2778+
#-----| false, true -> [assertion failure] access to parameter b3
27792779

27802780
# 140| access to parameter b2
27812781
#-----| false -> [assertion success] access to parameter b3
@@ -4924,7 +4924,7 @@ ExitMethods.cs:
49244924
#-----| -> ...;
49254925

49264926
# 22| call to method ErrorAlways
4927-
#-----| exception(Exception) -> exit M3 (abnormal)
4927+
#-----| exception(ArgumentException), exception(Exception) -> exit M3 (abnormal)
49284928

49294929
# 22| ...;
49304930
#-----| -> true

0 commit comments

Comments
 (0)