Skip to content

Commit 8a75971

Browse files
committed
Shared: Make sure getMadRepresentation is unique
1 parent 30ab9b7 commit 8a75971

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

shared/dataflow/codeql/dataflow/internal/FlowSummaryImpl.qll

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -686,6 +686,16 @@ module Make<
686686
derivedFluentFlowPush(_, _, _, head, tail, _)
687687
}
688688

689+
private string getUniqueMadRepresentation(SummaryComponent c) {
690+
result = unique( | | c.getMadRepresentation())
691+
or
692+
not exists(c.getMadRepresentation()) and
693+
result = "(missing)"
694+
or
695+
strictcount(c.getMadRepresentation()) > 1 and
696+
result = "(ambigous)"
697+
}
698+
689699
/**
690700
* A (non-empty) stack of summary components.
691701
*
@@ -732,7 +742,7 @@ module Make<
732742
exists(SummaryComponent head, SummaryComponentStack tail |
733743
head = this.head() and
734744
tail = this.tail() and
735-
result = tail.getMadRepresentation() + "." + head.getMadRepresentation()
745+
result = tail.getMadRepresentation() + "." + getUniqueMadRepresentation(head)
736746
)
737747
or
738748
exists(SummaryComponent c |

0 commit comments

Comments
 (0)