@@ -11,10 +11,9 @@ private import RangeAnalysisImpl
1111private import SignAnalysisSpecific as Specific
1212private import semmle.code.cpp.rangeanalysis.new.internal.semantic.Semantic
1313private import ConstantAnalysis
14- private import RangeUtils
1514private import Sign
1615
17- module SignAnalysis< DeltaSig D, UtilSig < Sem , D > Utils > {
16+ module SignAnalysis< DeltaSig D> {
1817 private import codeql.rangeanalysis.internal.RangeUtils:: MakeUtils< Sem , D >
1918
2019 /**
@@ -39,7 +38,7 @@ module SignAnalysis<DeltaSig D, UtilSig<Sem, D> Utils> {
3938
4039 /** An SSA definition whose sign is determined by the sign of that definitions source expression. */
4140 private class ExplicitSignDef extends FlowSignDef instanceof SemSsaExplicitUpdate {
42- final override Sign getSign ( ) { result = semExprSign ( super .getSourceExpr ( ) ) }
41+ final override Sign getSign ( ) { result = semExprSign ( super .getDefiningExpr ( ) ) }
4342 }
4443
4544 /** An SSA Phi definition, whose sign is the union of the signs of its inputs. */
@@ -148,7 +147,7 @@ module SignAnalysis<DeltaSig D, UtilSig<Sem, D> Utils> {
148147 not this instanceof ConstantSignExpr and
149148 (
150149 // Only track numeric types.
151- Utils :: getTrackedType ( this ) instanceof SemNumericType
150+ Sem :: getExprType ( this ) instanceof SemNumericType
152151 or
153152 // Unless the language says to track this expression anyway.
154153 Specific:: trackUnknownNonNumericExpr ( this )
@@ -203,7 +202,7 @@ module SignAnalysis<DeltaSig D, UtilSig<Sem, D> Utils> {
203202
204203 /** An expression of an unsigned type. */
205204 private class UnsignedExpr extends FlowSignExpr {
206- UnsignedExpr ( ) { Utils :: getTrackedType ( this ) instanceof SemUnsignedIntegerType }
205+ UnsignedExpr ( ) { Sem :: getExprType ( this ) instanceof SemUnsignedIntegerType }
207206
208207 override Sign getSignRestriction ( ) {
209208 result = TPos ( ) or
@@ -276,7 +275,7 @@ module SignAnalysis<DeltaSig D, UtilSig<Sem, D> Utils> {
276275 override SemUnboxExpr cast ;
277276
278277 UnboxSignExpr ( ) {
279- exists ( SemType fromType | fromType = Utils :: getTrackedType ( cast .getOperand ( ) ) |
278+ exists ( SemType fromType | fromType = Sem :: getExprType ( cast .getOperand ( ) ) |
280279 // Only numeric source types are handled here.
281280 fromType instanceof SemNumericType
282281 )
@@ -471,7 +470,7 @@ module SignAnalysis<DeltaSig D, UtilSig<Sem, D> Utils> {
471470 Sign semExprSign ( SemExpr e ) {
472471 exists ( Sign s | s = e .( SignExpr ) .getSign ( ) |
473472 if
474- Utils :: getTrackedType ( e ) instanceof SemUnsignedIntegerType and
473+ Sem :: getExprType ( e ) instanceof SemUnsignedIntegerType and
475474 s = TNeg ( ) and
476475 not Specific:: ignoreTypeRestrictions ( e )
477476 then result = TPos ( )
0 commit comments