@@ -37,7 +37,7 @@ Running the query
3737
3838 import cpp
3939
40- from IfStmt ifstmt, Block block
40+ from IfStmt ifstmt, BlockStmt block
4141 where ifstmt.getThen() = block and
4242 block.getNumStmt() = 0
4343 select ifstmt, "This 'if' statement is redundant."
@@ -81,10 +81,10 @@ After the initial ``import`` statement, this simple query comprises three parts
8181+===============================================================+===================================================================================================================+========================================================================================================================+
8282| ``import cpp `` | Imports the standard CodeQL libraries for C/C++. | Every query begins with one or more ``import `` statements. |
8383+---------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+
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: |
8585| | Declarations are of the form: | |
8686| | ``<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 |
8888+---------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+
8989| ``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. |
9090| | | |
0 commit comments