mirror of
https://github.com/github/codeql.git
synced 2026-04-28 02:05:14 +02:00
docs: a few content updates
This commit is contained in:
@@ -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``.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user