@@ -37,7 +37,7 @@ Running the query
37
37
38
38
import cpp
39
39
40
- from IfStmt ifstmt, Block block
40
+ from IfStmt ifstmt, BlockStmt block
41
41
where ifstmt.getThen() = block and
42
42
block.getNumStmt() = 0
43
43
select ifstmt, "This 'if' statement is redundant."
@@ -81,10 +81,10 @@ After the initial ``import`` statement, this simple query comprises three parts
81
81
+===============================================================+===================================================================================================================+========================================================================================================================+
82
82
| ``import cpp `` | Imports the standard CodeQL libraries for C/C++. | Every query begins with one or more ``import `` statements. |
83
83
+---------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+
84
- | ``from IfStmt ifstmt, Block block `` | Defines the variables for the query. | We use: |
84
+ | ``from IfStmt ifstmt, BlockStmt block `` | Defines the variables for the query. | We use: |
85
85
| | Declarations are of the form: | |
86
86
| | ``<type> <variable name> `` | - an ``IfStmt `` variable for ``if `` statements |
87
- | | | - a ``Block `` variable for the statement block |
87
+ | | | - a ``BlockStmt `` variable for the statement block |
88
88
+---------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+
89
89
| ``where ifstmt.getThen() = block and block.getNumStmt() = 0 `` | Defines a condition on the variables. | ``ifstmt.getThen() = block `` relates the two variables. The block must be the ``then `` branch of the ``if `` statement. |
90
90
| | | |
0 commit comments