CodeQL library for C#
codeql/csharp-all 0.9.2-dev (changelog, source)
Search

Module SignAnalysis

Provides sign analysis to determine whether expression are always positive or negative.

The analysis is implemented as an abstract interpretation over the three-valued domain {negative, zero, positive}.

Import path

import semmle.code.csharp.dataflow.SignAnalysis

Imports

csharp

The default C# QL library.

Predicates

negative

Holds if e can be negative and cannot be positive.

negativeExpr

Holds if e can be negative and cannot be positive.

positive

Holds if e can be positive and cannot be negative.

positiveExpr

Holds if e can be positive and cannot be negative.

strictlyNegative

Holds if e is strictly negative.

strictlyNegativeExpr

Holds if e is strictly negative.

strictlyPositive

Holds if e is strictly positive.

strictlyPositiveExpr

Holds if e is strictly positive.