Skip to content

Commit 65529af

Browse files
committed
SSA: Switch consistency counts to strictcount.
1 parent 6c183b8 commit 65529af

2 files changed

Lines changed: 13 additions & 21 deletions

File tree

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +0,0 @@
1-
| Definition cannot reach a read | 0 |
2-
| End of a basic block can be reached by multiple definitions | 0 |
3-
| Phi has less than 2 immediately prior references | 0 |
4-
| Phi node has less than two inputs | 0 |
5-
| Phi read has less than 2 immediately prior references | 0 |
6-
| Read can be reached from multiple definitions | 0 |
7-
| Read cannot be reached from a definition | 0 |
8-
| Read does not have a prior reference | 0 |
9-
| Read has multiple prior references | 0 |
10-
| Read is not dominated by a definition | 0 |

‎shared/ssa/codeql/ssa/Ssa.qll‎

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1409,52 +1409,54 @@ module Make<
14091409
// total results from all the SSA consistency query predicates.
14101410
type = "Read can be reached from multiple definitions" and
14111411
result =
1412-
count(Definition def, SourceVariable v, BasicBlock bb, int i | nonUniqueDef(def, v, bb, i))
1412+
strictcount(Definition def, SourceVariable v, BasicBlock bb, int i |
1413+
nonUniqueDef(def, v, bb, i)
1414+
)
14131415
or
14141416
type = "Read cannot be reached from a definition" and
1415-
result = count(SourceVariable v, BasicBlock bb, int i | readWithoutDef(v, bb, i))
1417+
result = strictcount(SourceVariable v, BasicBlock bb, int i | readWithoutDef(v, bb, i))
14161418
or
14171419
type = "Definition cannot reach a read" and
1418-
result = count(Definition def, SourceVariable v | deadDef(def, v))
1420+
result = strictcount(Definition def, SourceVariable v | deadDef(def, v))
14191421
or
14201422
type = "Read is not dominated by a definition" and
14211423
result =
1422-
count(Definition def, SourceVariable v, BasicBlock bb, int i |
1424+
strictcount(Definition def, SourceVariable v, BasicBlock bb, int i |
14231425
notDominatedByDef(def, v, bb, i)
14241426
)
14251427
or
14261428
type = "End of a basic block can be reached by multiple definitions" and
14271429
result =
1428-
count(Definition def, SourceVariable v, BasicBlock bb |
1430+
strictcount(Definition def, SourceVariable v, BasicBlock bb |
14291431
nonUniqueDefReachesEndOfBlock(def, v, bb)
14301432
)
14311433
or
14321434
type = "Phi node has less than two inputs" and
1433-
result = count(PhiNode phi, int inputs | uselessPhiNode(phi, inputs))
1435+
result = strictcount(PhiNode phi, int inputs | uselessPhiNode(phi, inputs))
14341436
or
14351437
type = "Read does not have a prior reference" and
1436-
result = count(SourceVariable v, BasicBlock bb, int i | readWithoutPriorRef(v, bb, i))
1438+
result = strictcount(SourceVariable v, BasicBlock bb, int i | readWithoutPriorRef(v, bb, i))
14371439
or
14381440
type = "Read has multiple prior references" and
14391441
result =
1440-
count(SourceVariable v, BasicBlock bb1, int i1, BasicBlock bb2, int i2 |
1442+
strictcount(SourceVariable v, BasicBlock bb1, int i1, BasicBlock bb2, int i2 |
14411443
readWithMultiplePriorRefs(v, bb1, i1, bb2, i2)
14421444
)
14431445
or
14441446
type = "Phi has less than 2 immediately prior references" and
14451447
result =
1446-
count(PhiNode phi, BasicBlock bbPhi, SourceVariable v, int inputRefs |
1448+
strictcount(PhiNode phi, BasicBlock bbPhi, SourceVariable v, int inputRefs |
14471449
phiWithoutTwoPriorRefs(phi, bbPhi, v, inputRefs)
14481450
)
14491451
or
14501452
type = "Phi read has less than 2 immediately prior references" and
14511453
result =
1452-
count(BasicBlock bbPhi, SourceVariable v, int inputRefs |
1454+
strictcount(BasicBlock bbPhi, SourceVariable v, int inputRefs |
14531455
phiReadWithoutTwoPriorRefs(bbPhi, v, inputRefs)
14541456
)
14551457
or
14561458
type = "Post-update without read" and
1457-
result = count(SourceVariable v, BasicBlock bb, int i | postUpdateWithoutRead(v, bb, i))
1459+
result = strictcount(SourceVariable v, BasicBlock bb, int i | postUpdateWithoutRead(v, bb, i))
14581460
}
14591461
}
14601462

0 commit comments

Comments
 (0)