Skip to content

Commit 38274db

Browse files
committed
Rangeanalysis: Parameterise library.
1 parent 169ba03 commit 38274db

File tree

2 files changed

+343
-198
lines changed

2 files changed

+343
-198
lines changed

cpp/ql/lib/semmle/code/cpp/rangeanalysis/new/internal/semantic/analysis/SignAnalysisCommon.qll

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -507,4 +507,16 @@ module SignAnalysis<DeltaSig D, UtilSig<D> Utils> {
507507
not semExprSign(e) = TPos() and
508508
not semExprSign(e) = TZero()
509509
}
510+
511+
/**
512+
* Holds if `e` may have positive values. This does not rule out the
513+
* possibilty for negative values.
514+
*/
515+
predicate semMayBePositive(SemExpr e) { semExprSign(e) = TPos() }
516+
517+
/**
518+
* Holds if `e` may have negative values. This does not rule out the
519+
* possibilty for positive values.
520+
*/
521+
predicate semMayBeNegative(SemExpr e) { semExprSign(e) = TNeg() }
510522
}

0 commit comments

Comments
 (0)