C++: Fix the AST wrapper for binary logical operators. · jacknojo/codeql@25647ba · GitHub
Skip to content

Commit 25647ba

Browse files
committed
C++: Fix the AST wrapper for binary logical operators.
1 parent 6445fd8 commit 25647ba

4 files changed

Lines changed: 38 additions & 14 deletions

File tree

‎cpp/ql/lib/semmle/code/cpp/controlflow/IRGuards.qll‎

Lines changed: 16 additions & 14 deletions

‎cpp/ql/test/library-tests/controlflow/guards-ir/tests.expected‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,9 @@ astGuardsControl
384384
| test.c:126:7:126:7 | 1 | true | 131 | 132 |
385385
| test.c:126:7:126:7 | 1 | true | 134 | 123 |
386386
| test.c:126:7:126:28 | ... && ... | true | 126 | 128 |
387+
| test.c:126:7:126:28 | ... && ... | true | 131 | 131 |
387388
| test.c:126:7:126:28 | ... && ... | true | 131 | 132 |
389+
| test.c:126:7:126:28 | ... && ... | true | 134 | 123 |
388390
| test.c:126:12:126:26 | call to test3_condition | true | 126 | 128 |
389391
| test.c:126:12:126:26 | call to test3_condition | true | 131 | 132 |
390392
| test.c:131:7:131:7 | b | true | 131 | 132 |
@@ -787,13 +789,21 @@ astGuardsEnsure_const
787789
| test.c:126:7:126:7 | 1 | test.c:126:7:126:7 | 1 | == | 1 | 131 | 132 |
788790
| test.c:126:7:126:7 | 1 | test.c:126:7:126:7 | 1 | == | 1 | 134 | 123 |
789791
| test.c:126:7:126:28 | ... && ... | test.c:126:7:126:7 | 1 | != | 0 | 126 | 128 |
792+
| test.c:126:7:126:28 | ... && ... | test.c:126:7:126:7 | 1 | != | 0 | 131 | 131 |
790793
| test.c:126:7:126:28 | ... && ... | test.c:126:7:126:7 | 1 | != | 0 | 131 | 132 |
794+
| test.c:126:7:126:28 | ... && ... | test.c:126:7:126:7 | 1 | != | 0 | 134 | 123 |
791795
| test.c:126:7:126:28 | ... && ... | test.c:126:7:126:7 | 1 | == | 1 | 126 | 128 |
796+
| test.c:126:7:126:28 | ... && ... | test.c:126:7:126:7 | 1 | == | 1 | 131 | 131 |
792797
| test.c:126:7:126:28 | ... && ... | test.c:126:7:126:7 | 1 | == | 1 | 131 | 132 |
798+
| test.c:126:7:126:28 | ... && ... | test.c:126:7:126:7 | 1 | == | 1 | 134 | 123 |
793799
| test.c:126:7:126:28 | ... && ... | test.c:126:12:126:26 | call to test3_condition | != | 0 | 126 | 128 |
800+
| test.c:126:7:126:28 | ... && ... | test.c:126:12:126:26 | call to test3_condition | != | 0 | 131 | 131 |
794801
| test.c:126:7:126:28 | ... && ... | test.c:126:12:126:26 | call to test3_condition | != | 0 | 131 | 132 |
802+
| test.c:126:7:126:28 | ... && ... | test.c:126:12:126:26 | call to test3_condition | != | 0 | 134 | 123 |
795803
| test.c:126:7:126:28 | ... && ... | test.c:126:12:126:26 | call to test3_condition | == | 1 | 126 | 128 |
804+
| test.c:126:7:126:28 | ... && ... | test.c:126:12:126:26 | call to test3_condition | == | 1 | 131 | 131 |
796805
| test.c:126:7:126:28 | ... && ... | test.c:126:12:126:26 | call to test3_condition | == | 1 | 131 | 132 |
806+
| test.c:126:7:126:28 | ... && ... | test.c:126:12:126:26 | call to test3_condition | == | 1 | 134 | 123 |
797807
| test.c:126:12:126:26 | call to test3_condition | test.c:126:12:126:26 | call to test3_condition | != | 0 | 126 | 128 |
798808
| test.c:126:12:126:26 | call to test3_condition | test.c:126:12:126:26 | call to test3_condition | != | 0 | 131 | 132 |
799809
| test.c:126:12:126:26 | call to test3_condition | test.c:126:12:126:26 | call to test3_condition | == | 1 | 126 | 128 |

‎cpp/ql/test/library-tests/controlflow/guards/GuardsControl.expected‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,13 @@
105105
| test.c:126:7:126:7 | 1 | true | test.c:131:10:132:16 | { ... } |
106106
| test.c:126:7:126:7 | 1 | true | test.c:134:1:123:10 | return ... |
107107
| test.c:126:7:126:28 | ... && ... | not 0 | test.c:126:31:128:16 | { ... } |
108+
| test.c:126:7:126:28 | ... && ... | not 0 | test.c:131:3:131:7 | if (...) ... |
108109
| test.c:126:7:126:28 | ... && ... | not 0 | test.c:131:10:132:16 | { ... } |
110+
| test.c:126:7:126:28 | ... && ... | not 0 | test.c:134:1:123:10 | return ... |
109111
| test.c:126:7:126:28 | ... && ... | true | test.c:126:31:128:16 | { ... } |
112+
| test.c:126:7:126:28 | ... && ... | true | test.c:131:3:131:7 | if (...) ... |
110113
| test.c:126:7:126:28 | ... && ... | true | test.c:131:10:132:16 | { ... } |
114+
| test.c:126:7:126:28 | ... && ... | true | test.c:134:1:123:10 | return ... |
111115
| test.c:126:12:126:26 | call to test3_condition | not 0 | test.c:126:31:128:16 | { ... } |
112116
| test.c:126:12:126:26 | call to test3_condition | not 0 | test.c:131:10:132:16 | { ... } |
113117
| test.c:126:12:126:26 | call to test3_condition | true | test.c:126:31:128:16 | { ... } |

‎cpp/ql/test/library-tests/controlflow/guards/GuardsEnsure.expected‎

Lines changed: 8 additions & 0 deletions

0 commit comments

Comments
 (0)