mirror of
https://github.com/github/codeql.git
synced 2026-04-26 01:05:15 +02:00
Java/C++: Share ssaUpdateStep.
This commit is contained in:
@@ -372,10 +372,6 @@ module JavaLangImpl implements LangSig<Sem, IntDelta> {
|
||||
module Utils implements UtilSig<Sem, IntDelta> {
|
||||
private import RangeUtils as RU
|
||||
|
||||
predicate semSsaUpdateStep(Sem::SsaExplicitUpdate v, Sem::Expr e, int delta) {
|
||||
RU::ssaUpdateStep(v, e, delta)
|
||||
}
|
||||
|
||||
predicate semValueFlowStep = RU::valueFlowStep/3;
|
||||
|
||||
Sem::Type getTrackedTypeForSsaVariable(Sem::SsaVariable var) {
|
||||
|
||||
@@ -15,6 +15,8 @@ private predicate backEdge = U::backEdge/3;
|
||||
|
||||
predicate ssaRead = U::ssaRead/2;
|
||||
|
||||
predicate ssaUpdateStep = U::ssaUpdateStep/3;
|
||||
|
||||
predicate guardDirectlyControlsSsaRead = U::guardDirectlyControlsSsaRead/3;
|
||||
|
||||
predicate guardControlsSsaRead = U::guardControlsSsaRead/3;
|
||||
@@ -158,23 +160,6 @@ class ConstantStringExpr extends Expr {
|
||||
string getStringValue() { constantStringExpr(this, result) }
|
||||
}
|
||||
|
||||
/**
|
||||
* Holds if `v` is an `SsaExplicitUpdate` that equals `e + delta`.
|
||||
*/
|
||||
predicate ssaUpdateStep(SsaExplicitUpdate v, Expr e, int delta) {
|
||||
v.getDefiningExpr().(VariableAssign).getSource() = e and delta = 0
|
||||
or
|
||||
v.getDefiningExpr().(PostIncExpr).getExpr() = e and delta = 1
|
||||
or
|
||||
v.getDefiningExpr().(PreIncExpr).getExpr() = e and delta = 1
|
||||
or
|
||||
v.getDefiningExpr().(PostDecExpr).getExpr() = e and delta = -1
|
||||
or
|
||||
v.getDefiningExpr().(PreDecExpr).getExpr() = e and delta = -1
|
||||
or
|
||||
v.getDefiningExpr().(AssignOp) = e and delta = 0
|
||||
}
|
||||
|
||||
/**
|
||||
* Holds if `e1 + delta` equals `e2`.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user