mirror of
https://github.com/github/codeql.git
synced 2026-05-05 05:35:13 +02:00
Apply suggestions from code review
Co-Authored-By: James Fletcher <42464962+jf205@users.noreply.github.com>
This commit is contained in:
@@ -3,7 +3,8 @@ Using the guards library in C and C++
|
||||
|
||||
Overview
|
||||
--------
|
||||
The guards library (defined in ``semmle.code.cpp.controlflow.Guards``) provides a class ``GuardCondition`` representing Boolean values that are used to make control flow decisions. A ``GuardCondition`` is considered to guard a basic block if the block is only reached if the ``GuardCondition`` evaluated a certain way. For instance, in the following code, ``x < 10`` is a ``GuardCondition``, and it guards all the code before the return statement.
|
||||
The guards library (defined in ``semmle.code.cpp.controlflow.Guards``) provides a class ``GuardCondition`` representing Boolean values that are used to make control flow decisions.
|
||||
A ``GuardCondition`` is considered to guard a basic block if the block can only be reached if the ``GuardCondition`` is evaluated a certain way. For instance, in the following code, ``x < 10`` is a ``GuardCondition``, and it guards all the code before the return statement.
|
||||
|
||||
.. code:: cpp
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ The range analysis library (defined in ``semmle.code.cpp.rangeanalysis.SimpleRan
|
||||
|
||||
Bounds predicates
|
||||
-----------------
|
||||
The ``upperBound`` and ``lowerBound`` predicates provide constant bounds on expressions. No conversions of the argument are included in the bound; in the common case that your query needs to take conversions into account, call them on the converted form, such as ``upperBound(expr.getFullyConverted())``.
|
||||
The ``upperBound`` and ``lowerBound`` predicates provide constant bounds on expressions. No conversions of the argument are included in the bound. In the common case that your query needs to take conversions into account, call them on the converted form, such as ``upperBound(expr.getFullyConverted())``.
|
||||
|
||||
Overflow predicates
|
||||
-------------------
|
||||
|
||||
Reference in New Issue
Block a user