Skip to content

Commit c187a7a

Browse files
committed
Dataflow: Address review comments.
1 parent 5042753 commit c187a7a

File tree

1 file changed

+9
-15
lines changed

1 file changed

+9
-15
lines changed

shared/dataflow/codeql/dataflow/internal/DataFlowImpl.qll

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1423,6 +1423,12 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
14231423

14241424
private class TypOption = TypOption::Option;
14251425

1426+
private string ppStored(TypOption stored) {
1427+
exists(string ppt | ppt = stored.toString() |
1428+
if stored.isNone() or ppt = "" then result = "" else result = " : " + ppt
1429+
)
1430+
}
1431+
14261432
/* Begin: Stage logic. */
14271433
pragma[nomagic]
14281434
private Typ getNodeTyp(NodeEx node) {
@@ -1604,14 +1610,8 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
16041610

16051611
private string ppTyp() { result = t.toString() and result != "" }
16061612

1607-
private string ppStored() {
1608-
exists(string ppt | ppt = stored.toString() |
1609-
if stored.isNone() or ppt = "" then result = "" else result = " : " + ppt
1610-
)
1611-
}
1612-
16131613
override string toString() {
1614-
result = p + concat(" : " + this.ppTyp()) + " " + ap + this.ppStored()
1614+
result = p + concat(" : " + this.ppTyp()) + " " + ap + ppStored(stored)
16151615
}
16161616

16171617
override Location getLocation() { result = p.getLocation() }
@@ -3050,12 +3050,6 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
30503050
)
30513051
}
30523052

3053-
private string ppStored() {
3054-
exists(string ppt | ppt = stored.toString() |
3055-
if stored.isNone() or ppt = "" then result = "" else result = " : " + ppt
3056-
)
3057-
}
3058-
30593053
private string ppCtx() { result = " <" + cc + ">" }
30603054

30613055
private string ppSummaryCtx() {
@@ -3066,7 +3060,7 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
30663060
}
30673061

30683062
override string toString() {
3069-
result = node.toString() + this.ppType() + this.ppAp() + this.ppStored()
3063+
result = node.toString() + this.ppType() + this.ppAp() + ppStored(stored)
30703064
}
30713065

30723066
/**
@@ -3075,7 +3069,7 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
30753069
*/
30763070
string toStringWithContext() {
30773071
result =
3078-
node.toString() + this.ppType() + this.ppAp() + this.ppStored() + this.ppCtx() +
3072+
node.toString() + this.ppType() + this.ppAp() + ppStored(stored) + this.ppCtx() +
30793073
this.ppSummaryCtx()
30803074
}
30813075

0 commit comments

Comments
 (0)