TypeFlow: Rename step to uniqStep.

This commit is contained in:
Anders Schack-Mulligen
2024-10-28 15:00:05 +01:00
parent b112a9b31e
commit 3939eff260
4 changed files with 10 additions and 10 deletions

View File

@@ -199,7 +199,7 @@ private module Input implements TypeFlowInput<Location> {
i2.(PointerArithmeticInstruction).getLeft() = i1
}
predicate step(TypeFlowNode n1, TypeFlowNode n2) {
predicate uniqStep(TypeFlowNode n1, TypeFlowNode n2) {
instructionStep(n1.asInstruction(), n2.asInstruction())
}
@@ -246,7 +246,7 @@ private module Input implements TypeFlowInput<Location> {
pragma[nomagic]
private predicate upcastCand(TypeFlowNode n, Type t1, Type t2) {
exists(TypeFlowNode next |
step(n, next)
uniqStep(n, next)
or
joinStep(n, next)
|

View File

@@ -118,7 +118,7 @@ private module Input implements TypeFlowInput<Location> {
* Holds if data can flow from `n1` to `n2` in one step, and `n1` is
* functionally determined by `n2`.
*/
predicate step(TypeFlowNode n1, TypeFlowNode n2) {
predicate uniqStep(TypeFlowNode n1, TypeFlowNode n2) {
n2.asExpr() = n1.asField().getAnAccess()
or
n2.asExpr() = n1.asSsa().getAUse()
@@ -169,7 +169,7 @@ private module Input implements TypeFlowInput<Location> {
*/
pragma[nomagic]
private predicate upcastCand(TypeFlowNode n, RefType t1, RefType t1e, RefType t2, RefType t2e) {
exists(TypeFlowNode next | step(n, next) or joinStep(n, next) |
exists(TypeFlowNode next | uniqStep(n, next) or joinStep(n, next) |
n.getType() = t1 and
next.getType() = t2 and
t1.getErasure() = t1e and

View File

@@ -37,7 +37,7 @@ signature module TypeFlowInput<LocationSig Location> {
* Holds if data can flow from `n1` to `n2` in one step, and `n1` is
* functionally determined by `n2`.
*/
predicate step(TypeFlowNode n1, TypeFlowNode n2);
predicate uniqStep(TypeFlowNode n1, TypeFlowNode n2);
/** Holds if `n` represents a `null` value. */
predicate isNullValue(TypeFlowNode n);

View File

@@ -9,7 +9,7 @@ module TypeFlow<LocationSig Location, TypeFlowInput<Location> I> {
predicate isNull(TypeFlowNode n) {
isNullValue(n)
or
exists(TypeFlowNode mid | isNull(mid) and step(mid, n))
exists(TypeFlowNode mid | isNull(mid) and uniqStep(mid, n))
or
forex(TypeFlowNode mid | joinStep(mid, n) | isNull(mid)) and
not isExcludedFromNullAnalysis(n)
@@ -24,7 +24,7 @@ module TypeFlow<LocationSig Location, TypeFlowInput<Location> I> {
}
private predicate anyStep(TypeFlowNode n1, TypeFlowNode n2) {
joinStepNotNull(n1, n2) or step(n1, n2)
joinStepNotNull(n1, n2) or uniqStep(n1, n2)
}
private predicate sccEdge(TypeFlowNode n1, TypeFlowNode n2) {
@@ -171,7 +171,7 @@ module TypeFlow<LocationSig Location, TypeFlowInput<Location> I> {
private predicate exactType(TypeFlowNode n, Type t) {
exactTypeBase(n, t)
or
exists(TypeFlowNode mid | exactType(mid, t) and step(mid, n))
exists(TypeFlowNode mid | exactType(mid, t) and uniqStep(mid, n))
or
// The following is an optimized version of
// `forex(TypeFlowNode mid | joinStepNotNull(mid, n) | exactType(mid, t))`
@@ -234,7 +234,7 @@ module TypeFlow<LocationSig Location, TypeFlowInput<Location> I> {
private predicate typeFlow(TypeFlowNode n, Type t) {
typeFlowBase(n, t)
or
exists(TypeFlowNode mid | typeFlow(mid, t) and step(mid, n))
exists(TypeFlowNode mid | typeFlow(mid, t) and uniqStep(mid, n))
or
ForAll<TypeFlowNode, RankedJoinStep, TypeFlowPropagation>::flowJoin(n, t)
or
@@ -366,7 +366,7 @@ module TypeFlow<LocationSig Location, TypeFlowInput<Location> I> {
ForAll<TypeFlowScc, RankedSccJoinStep, HasUnionTypePropagation>::flowJoin(scc, _)
)
or
exists(TypeFlowNode mid | step(mid, n) and hasUnionTypeFlow(mid))
exists(TypeFlowNode mid | uniqStep(mid, n) and hasUnionTypeFlow(mid))
or
instanceofDisjunctionGuarded(n, _)
)