Java: Fix RangeAnalysis/ModulusAnalysis.

This commit is contained in:
Anders Schack-Mulligen
2026-02-09 14:05:07 +01:00
parent 6fbdb2c52b
commit 1e9dcea88b
3 changed files with 38 additions and 2 deletions

View File

@@ -220,6 +220,8 @@ module Sem implements Semantic<Location> {
int getBlockId1(BasicBlock bb) { idOf(bb, result) }
string getBlockId2(BasicBlock bb) { bb.getFirstNode().getIdTag() = result }
class Guard extends G::Guards_v2::Guard {
Expr asExpr() { result = this }
}

View File

@@ -23,7 +23,9 @@ private predicate idOfAst(BB::ExprParent x, int y) = equivalenceRelation(id/2)(x
private predicate idOf(BasicBlock x, int y) { idOfAst(x.getFirstNode().getAstNode(), y) }
private int getId(BasicBlock bb) { idOf(bb, result) }
private int getId1(BasicBlock bb) { idOf(bb, result) }
private string getId2(BasicBlock bb) { bb.getFirstNode().getIdTag() = result }
/**
* Declarations to be exposed to users of SsaReadPositionCommon
@@ -39,7 +41,7 @@ module Public {
rank[r](SsaReadPositionPhiInputEdge e |
e.phiInput(phi, _)
|
e order by getId(e.getOrigBlock())
e order by getId1(e.getOrigBlock()), getId2(e.getOrigBlock())
)
}
}