docs: a few content updates

This commit is contained in:
james
2020-02-17 15:08:30 +00:00
parent d3eb5334b8
commit 6ff1c99ae3
9 changed files with 30 additions and 37 deletions

View File

@@ -3,8 +3,8 @@ Using the guards library in C and C++
You can use the CodeQL guards library to identify conditional expressions that control the execution of other code in C and C++ codebases.
Overview
--------
About the guards library
------------------------
The guards library (defined in ``semmle.code.cpp.controlflow.Guards``) provides a class `GuardCondition <https://help.semmle.com/qldoc/cpp/semmle/code/cpp/controlflow/Guards.qll/type.Guards$GuardCondition.html>`__ 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.
@@ -22,7 +22,7 @@ A ``GuardCondition`` is considered to guard a basic block if the block can only
The ``controls`` predicate
------------------------------------------------
--------------------------
The ``controls`` predicate helps determine which blocks are only run when the ``GuardCondition`` evaluates a certain way. ``guard.controls(block, testIsTrue)`` holds if ``block`` is only entered if the value of this condition is ``testIsTrue``.