mirror of
https://github.com/github/codeql.git
synced 2025-12-16 16:53:25 +01:00
C++: Update the tests for guard conditions so that the tests print more detailed location information.
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -38,4 +38,4 @@ where
|
||||
|
|
||||
msg = left + op + k + " when " + guard + " is " + value
|
||||
)
|
||||
select guard.getLocation().getStartLine(), msg
|
||||
select guard, msg
|
||||
|
||||
@@ -1,165 +1,170 @@
|
||||
| test.c:7:9:7:13 | ... > ... | false | 10 | 11 |
|
||||
| test.c:7:9:7:13 | ... > ... | true | 7 | 9 |
|
||||
| test.c:17:8:17:12 | ... < ... | true | 17 | 17 |
|
||||
| test.c:17:8:17:12 | ... < ... | true | 18 | 18 |
|
||||
| test.c:17:8:17:21 | ... && ... | true | 18 | 18 |
|
||||
| test.c:17:17:17:21 | ... > ... | true | 18 | 18 |
|
||||
| test.c:26:11:26:15 | ... > ... | false | 2 | 2 |
|
||||
| test.c:26:11:26:15 | ... > ... | false | 31 | 34 |
|
||||
| test.c:26:11:26:15 | ... > ... | false | 34 | 34 |
|
||||
| test.c:26:11:26:15 | ... > ... | false | 39 | 42 |
|
||||
| test.c:26:11:26:15 | ... > ... | false | 42 | 42 |
|
||||
| test.c:26:11:26:15 | ... > ... | false | 42 | 44 |
|
||||
| test.c:26:11:26:15 | ... > ... | false | 45 | 45 |
|
||||
| test.c:26:11:26:15 | ... > ... | false | 45 | 47 |
|
||||
| test.c:26:11:26:15 | ... > ... | false | 51 | 53 |
|
||||
| test.c:26:11:26:15 | ... > ... | false | 56 | 58 |
|
||||
| test.c:26:11:26:15 | ... > ... | false | 58 | 58 |
|
||||
| test.c:26:11:26:15 | ... > ... | false | 58 | 66 |
|
||||
| test.c:26:11:26:15 | ... > ... | false | 62 | 62 |
|
||||
| test.c:26:11:26:15 | ... > ... | true | 26 | 28 |
|
||||
| test.c:34:16:34:21 | ... < ... | false | 2 | 2 |
|
||||
| test.c:34:16:34:21 | ... < ... | false | 39 | 42 |
|
||||
| test.c:34:16:34:21 | ... < ... | false | 42 | 42 |
|
||||
| test.c:34:16:34:21 | ... < ... | false | 42 | 44 |
|
||||
| test.c:34:16:34:21 | ... < ... | false | 45 | 45 |
|
||||
| test.c:34:16:34:21 | ... < ... | false | 45 | 47 |
|
||||
| test.c:34:16:34:21 | ... < ... | false | 51 | 53 |
|
||||
| test.c:34:16:34:21 | ... < ... | false | 56 | 58 |
|
||||
| test.c:34:16:34:21 | ... < ... | false | 58 | 58 |
|
||||
| test.c:34:16:34:21 | ... < ... | false | 58 | 66 |
|
||||
| test.c:34:16:34:21 | ... < ... | false | 62 | 62 |
|
||||
| test.c:34:16:34:21 | ... < ... | true | 34 | 34 |
|
||||
| test.c:42:16:42:21 | ... < ... | true | 42 | 42 |
|
||||
| test.c:42:16:42:21 | ... < ... | true | 42 | 44 |
|
||||
| test.c:42:16:42:21 | ... < ... | true | 45 | 45 |
|
||||
| test.c:42:16:42:21 | ... < ... | true | 45 | 47 |
|
||||
| test.c:42:16:42:21 | ... < ... | true | 51 | 53 |
|
||||
| test.c:44:12:44:16 | ... > ... | false | 42 | 42 |
|
||||
| test.c:44:12:44:16 | ... > ... | false | 51 | 53 |
|
||||
| test.c:44:12:44:16 | ... > ... | true | 45 | 45 |
|
||||
| test.c:44:12:44:16 | ... > ... | true | 45 | 47 |
|
||||
| test.c:45:16:45:20 | ... > ... | true | 45 | 47 |
|
||||
| test.c:58:9:58:14 | ... == ... | false | 58 | 58 |
|
||||
| test.c:58:9:58:14 | ... == ... | false | 62 | 62 |
|
||||
| test.c:58:9:58:23 | ... \|\| ... | false | 62 | 62 |
|
||||
| test.c:58:19:58:23 | ... < ... | false | 62 | 62 |
|
||||
| test.c:75:9:75:14 | ... == ... | false | 78 | 79 |
|
||||
| test.c:75:9:75:14 | ... == ... | true | 75 | 77 |
|
||||
| test.c:85:8:85:13 | ... == ... | true | 85 | 85 |
|
||||
| test.c:85:8:85:13 | ... == ... | true | 86 | 86 |
|
||||
| test.c:85:8:85:23 | ... && ... | true | 86 | 86 |
|
||||
| test.c:85:18:85:23 | ... != ... | true | 86 | 86 |
|
||||
| test.c:94:11:94:16 | ... != ... | false | 70 | 70 |
|
||||
| test.c:94:11:94:16 | ... != ... | false | 99 | 102 |
|
||||
| test.c:94:11:94:16 | ... != ... | false | 102 | 102 |
|
||||
| test.c:94:11:94:16 | ... != ... | false | 107 | 109 |
|
||||
| test.c:94:11:94:16 | ... != ... | false | 109 | 109 |
|
||||
| test.c:94:11:94:16 | ... != ... | false | 109 | 117 |
|
||||
| test.c:94:11:94:16 | ... != ... | false | 113 | 113 |
|
||||
| test.c:94:11:94:16 | ... != ... | true | 94 | 96 |
|
||||
| test.c:102:16:102:21 | ... < ... | false | 70 | 70 |
|
||||
| test.c:102:16:102:21 | ... < ... | false | 107 | 109 |
|
||||
| test.c:102:16:102:21 | ... < ... | false | 109 | 109 |
|
||||
| test.c:102:16:102:21 | ... < ... | false | 109 | 117 |
|
||||
| test.c:102:16:102:21 | ... < ... | false | 113 | 113 |
|
||||
| test.c:102:16:102:21 | ... < ... | true | 102 | 102 |
|
||||
| test.c:109:9:109:14 | ... == ... | false | 109 | 109 |
|
||||
| test.c:109:9:109:14 | ... == ... | false | 113 | 113 |
|
||||
| test.c:109:9:109:23 | ... \|\| ... | false | 113 | 113 |
|
||||
| test.c:109:19:109:23 | ... < ... | false | 113 | 113 |
|
||||
| test.c:126:7:126:7 | 1 | true | 126 | 126 |
|
||||
| test.c:126:7:126:7 | 1 | true | 126 | 128 |
|
||||
| test.c:126:7:126:7 | 1 | true | 131 | 131 |
|
||||
| test.c:126:7:126:7 | 1 | true | 131 | 132 |
|
||||
| test.c:126:7:126:7 | 1 | true | 134 | 123 |
|
||||
| test.c:126:7:126:28 | ... && ... | true | 126 | 128 |
|
||||
| test.c:126:12:126:26 | call to test3_condition | true | 126 | 128 |
|
||||
| test.c:131:7:131:7 | b | true | 131 | 132 |
|
||||
| test.c:137:7:137:7 | 0 | false | 142 | 136 |
|
||||
| test.c:146:7:146:8 | ! ... | true | 146 | 147 |
|
||||
| test.c:146:8:146:8 | x | false | 146 | 147 |
|
||||
| test.c:152:8:152:8 | p | true | 152 | 154 |
|
||||
| test.c:158:8:158:9 | ! ... | true | 158 | 160 |
|
||||
| test.c:158:9:158:9 | p | false | 158 | 160 |
|
||||
| test.c:164:8:164:8 | s | true | 164 | 166 |
|
||||
| test.c:170:8:170:9 | ! ... | true | 170 | 172 |
|
||||
| test.c:170:9:170:9 | s | false | 170 | 172 |
|
||||
| test.c:176:8:176:15 | ! ... | true | 176 | 178 |
|
||||
| test.c:176:10:176:14 | ... < ... | false | 176 | 178 |
|
||||
| test.c:182:8:182:34 | ! ... | true | 182 | 184 |
|
||||
| test.c:182:10:182:20 | ... >= ... | true | 181 | 182 |
|
||||
| test.c:182:10:182:20 | ... >= ... | true | 182 | 182 |
|
||||
| test.c:182:10:182:33 | ... && ... | false | 182 | 184 |
|
||||
| test.c:182:10:182:33 | ... && ... | true | 181 | 182 |
|
||||
| test.c:182:25:182:33 | ... < ... | true | 181 | 182 |
|
||||
| test.c:190:7:190:8 | ! ... | true | 190 | 192 |
|
||||
| test.c:190:8:190:8 | c | false | 190 | 192 |
|
||||
| test.c:198:7:198:8 | ! ... | true | 198 | 200 |
|
||||
| test.c:198:8:198:8 | b | false | 198 | 200 |
|
||||
| test.c:206:7:206:8 | ! ... | true | 206 | 208 |
|
||||
| test.c:206:8:206:8 | c | false | 206 | 208 |
|
||||
| test.cpp:18:8:18:10 | call to get | true | 19 | 19 |
|
||||
| test.cpp:31:7:31:13 | ... == ... | false | 30 | 30 |
|
||||
| test.cpp:31:7:31:13 | ... == ... | false | 34 | 34 |
|
||||
| test.cpp:31:7:31:13 | ... == ... | true | 30 | 30 |
|
||||
| test.cpp:31:7:31:13 | ... == ... | true | 31 | 32 |
|
||||
| test.cpp:42:13:42:20 | call to getABool | true | 43 | 45 |
|
||||
| test.cpp:61:10:61:10 | i | Case[0] | 62 | 64 |
|
||||
| test.cpp:61:10:61:10 | i | Case[1] | 65 | 66 |
|
||||
| test.cpp:74:10:74:10 | i | Case[0..10] | 75 | 77 |
|
||||
| test.cpp:74:10:74:10 | i | Case[11..20] | 78 | 79 |
|
||||
| test.cpp:93:6:93:6 | c | true | 93 | 94 |
|
||||
| test.cpp:99:6:99:6 | f | true | 99 | 100 |
|
||||
| test.cpp:105:6:105:14 | ... != ... | true | 105 | 106 |
|
||||
| test.cpp:111:6:111:14 | ... != ... | true | 111 | 112 |
|
||||
| test.cpp:122:9:122:9 | b | true | 123 | 125 |
|
||||
| test.cpp:122:9:122:9 | b | true | 125 | 125 |
|
||||
| test.cpp:125:13:125:20 | ! ... | true | 125 | 125 |
|
||||
| test.cpp:125:14:125:17 | call to safe | false | 125 | 125 |
|
||||
| test.cpp:131:6:131:21 | call to __builtin_expect | true | 131 | 132 |
|
||||
| test.cpp:135:6:135:21 | call to __builtin_expect | true | 135 | 136 |
|
||||
| test.cpp:141:6:141:21 | call to __builtin_expect | true | 141 | 142 |
|
||||
| test.cpp:145:6:145:21 | call to __builtin_expect | true | 145 | 146 |
|
||||
| test.cpp:152:7:152:8 | ! ... | true | 152 | 153 |
|
||||
| test.cpp:152:8:152:8 | b | false | 152 | 153 |
|
||||
| test.cpp:160:7:160:8 | ! ... | true | 160 | 162 |
|
||||
| test.cpp:160:8:160:8 | c | false | 160 | 162 |
|
||||
| test.cpp:168:7:168:8 | ! ... | true | 168 | 170 |
|
||||
| test.cpp:168:8:168:8 | b | false | 168 | 170 |
|
||||
| test.cpp:176:7:176:8 | ! ... | true | 176 | 178 |
|
||||
| test.cpp:176:8:176:8 | c | false | 176 | 178 |
|
||||
| test.cpp:182:6:182:16 | ! ... | false | 185 | 188 |
|
||||
| test.cpp:182:6:182:16 | ! ... | true | 182 | 184 |
|
||||
| test.cpp:182:8:182:9 | b1 | true | 181 | 182 |
|
||||
| test.cpp:182:8:182:9 | b1 | true | 182 | 182 |
|
||||
| test.cpp:182:8:182:15 | ... && ... | false | 182 | 184 |
|
||||
| test.cpp:182:8:182:15 | ... && ... | true | 181 | 182 |
|
||||
| test.cpp:182:8:182:15 | ... && ... | true | 185 | 188 |
|
||||
| test.cpp:182:14:182:15 | b2 | true | 181 | 182 |
|
||||
| test.cpp:193:6:193:16 | ! ... | false | 197 | 199 |
|
||||
| test.cpp:193:6:193:16 | ! ... | true | 193 | 196 |
|
||||
| test.cpp:193:8:193:9 | b1 | false | 192 | 193 |
|
||||
| test.cpp:193:8:193:9 | b1 | false | 193 | 193 |
|
||||
| test.cpp:193:8:193:15 | ... \|\| ... | false | 192 | 193 |
|
||||
| test.cpp:193:8:193:15 | ... \|\| ... | false | 193 | 196 |
|
||||
| test.cpp:193:8:193:15 | ... \|\| ... | true | 197 | 199 |
|
||||
| test.cpp:193:14:193:15 | b2 | false | 192 | 193 |
|
||||
| test.cpp:211:9:211:15 | ... == ... | true | 211 | 212 |
|
||||
| test.cpp:214:9:214:17 | ... == ... | true | 214 | 215 |
|
||||
| test.cpp:217:9:217:15 | ... == ... | true | 217 | 218 |
|
||||
| test.cpp:220:9:220:14 | ... == ... | true | 220 | 221 |
|
||||
| test.cpp:223:9:223:16 | ... == ... | true | 223 | 224 |
|
||||
| test.cpp:226:9:226:14 | ... == ... | true | 226 | 227 |
|
||||
| test.cpp:229:9:229:14 | ... == ... | true | 229 | 230 |
|
||||
| test.cpp:232:9:232:18 | ... == ... | true | 232 | 233 |
|
||||
| test.cpp:235:9:235:17 | ... == ... | true | 235 | 236 |
|
||||
| test.cpp:238:9:238:17 | ... == ... | true | 238 | 239 |
|
||||
| test.cpp:241:9:241:17 | ... == ... | true | 241 | 241 |
|
||||
| test.cpp:241:9:241:17 | ... == ... | true | 241 | 242 |
|
||||
| test.cpp:241:9:241:30 | ... && ... | true | 241 | 241 |
|
||||
| test.cpp:241:9:241:30 | ... && ... | true | 241 | 242 |
|
||||
| test.cpp:241:9:241:43 | ... && ... | true | 241 | 242 |
|
||||
| test.cpp:241:22:241:30 | ... == ... | true | 241 | 241 |
|
||||
| test.cpp:241:22:241:30 | ... == ... | true | 241 | 242 |
|
||||
| test.cpp:241:35:241:43 | ... == ... | true | 241 | 242 |
|
||||
| test.c:7:9:7:13 | ... > ... | false | test.c:10:12:11:14 | { ... } |
|
||||
| test.c:7:9:7:13 | ... > ... | true | test.c:7:16:9:14 | { ... } |
|
||||
| test.c:17:8:17:12 | ... < ... | true | test.c:17:17:17:21 | y |
|
||||
| test.c:17:8:17:12 | ... < ... | true | test.c:18:9:18:14 | ExprStmt |
|
||||
| test.c:17:8:17:21 | ... && ... | true | test.c:18:9:18:14 | ExprStmt |
|
||||
| test.c:17:17:17:21 | ... > ... | true | test.c:18:9:18:14 | ExprStmt |
|
||||
| test.c:26:11:26:15 | ... > ... | false | test.c:2:5:2:8 | test |
|
||||
| test.c:26:11:26:15 | ... > ... | false | test.c:31:5:34:13 | ExprStmt |
|
||||
| test.c:26:11:26:15 | ... > ... | false | test.c:34:16:34:21 | j |
|
||||
| test.c:26:11:26:15 | ... > ... | false | test.c:34:29:34:26 | { ... } |
|
||||
| test.c:26:11:26:15 | ... > ... | false | test.c:39:5:42:13 | ExprStmt |
|
||||
| test.c:26:11:26:15 | ... > ... | false | test.c:42:5:42:26 | label ...: |
|
||||
| test.c:26:11:26:15 | ... > ... | false | test.c:42:16:42:21 | j |
|
||||
| test.c:26:11:26:15 | ... > ... | false | test.c:42:29:44:16 | { ... } |
|
||||
| test.c:26:11:26:15 | ... > ... | false | test.c:45:13:45:20 | if (...) ... |
|
||||
| test.c:26:11:26:15 | ... > ... | false | test.c:45:23:47:22 | { ... } |
|
||||
| test.c:26:11:26:15 | ... > ... | false | test.c:51:14:53:21 | { ... } |
|
||||
| test.c:26:11:26:15 | ... > ... | false | test.c:56:5:58:14 | label ...: |
|
||||
| test.c:26:11:26:15 | ... > ... | false | test.c:58:19:58:23 | y |
|
||||
| test.c:26:11:26:15 | ... > ... | false | test.c:58:26:66:12 | { ... } |
|
||||
| test.c:26:11:26:15 | ... > ... | false | test.c:62:9:62:16 | return ... |
|
||||
| test.c:26:11:26:15 | ... > ... | true | test.c:26:18:28:11 | { ... } |
|
||||
| test.c:34:16:34:21 | ... < ... | false | test.c:2:5:2:8 | test |
|
||||
| test.c:34:16:34:21 | ... < ... | false | test.c:39:5:42:13 | ExprStmt |
|
||||
| test.c:34:16:34:21 | ... < ... | false | test.c:42:5:42:26 | label ...: |
|
||||
| test.c:34:16:34:21 | ... < ... | false | test.c:42:16:42:21 | j |
|
||||
| test.c:34:16:34:21 | ... < ... | false | test.c:42:29:44:16 | { ... } |
|
||||
| test.c:34:16:34:21 | ... < ... | false | test.c:45:13:45:20 | if (...) ... |
|
||||
| test.c:34:16:34:21 | ... < ... | false | test.c:45:23:47:22 | { ... } |
|
||||
| test.c:34:16:34:21 | ... < ... | false | test.c:51:14:53:21 | { ... } |
|
||||
| test.c:34:16:34:21 | ... < ... | false | test.c:56:5:58:14 | label ...: |
|
||||
| test.c:34:16:34:21 | ... < ... | false | test.c:58:19:58:23 | y |
|
||||
| test.c:34:16:34:21 | ... < ... | false | test.c:58:26:66:12 | { ... } |
|
||||
| test.c:34:16:34:21 | ... < ... | false | test.c:62:9:62:16 | return ... |
|
||||
| test.c:34:16:34:21 | ... < ... | true | test.c:34:29:34:26 | { ... } |
|
||||
| test.c:42:16:42:21 | ... < ... | true | test.c:42:5:42:26 | label ...: |
|
||||
| test.c:42:16:42:21 | ... < ... | true | test.c:42:29:44:16 | { ... } |
|
||||
| test.c:42:16:42:21 | ... < ... | true | test.c:45:13:45:20 | if (...) ... |
|
||||
| test.c:42:16:42:21 | ... < ... | true | test.c:45:23:47:22 | { ... } |
|
||||
| test.c:42:16:42:21 | ... < ... | true | test.c:51:14:53:21 | { ... } |
|
||||
| test.c:44:12:44:16 | ... > ... | false | test.c:42:5:42:26 | label ...: |
|
||||
| test.c:44:12:44:16 | ... > ... | false | test.c:51:14:53:21 | { ... } |
|
||||
| test.c:44:12:44:16 | ... > ... | true | test.c:45:13:45:20 | if (...) ... |
|
||||
| test.c:44:12:44:16 | ... > ... | true | test.c:45:23:47:22 | { ... } |
|
||||
| test.c:45:16:45:20 | ... > ... | true | test.c:45:23:47:22 | { ... } |
|
||||
| test.c:58:9:58:14 | ... == ... | false | test.c:58:19:58:23 | y |
|
||||
| test.c:58:9:58:14 | ... == ... | false | test.c:62:9:62:16 | return ... |
|
||||
| test.c:58:9:58:23 | ... \|\| ... | false | test.c:62:9:62:16 | return ... |
|
||||
| test.c:58:19:58:23 | ... < ... | false | test.c:62:9:62:16 | return ... |
|
||||
| test.c:75:9:75:14 | ... == ... | false | test.c:78:12:79:14 | { ... } |
|
||||
| test.c:75:9:75:14 | ... == ... | true | test.c:75:17:77:14 | { ... } |
|
||||
| test.c:85:8:85:13 | ... == ... | true | test.c:85:18:85:23 | y |
|
||||
| test.c:85:8:85:13 | ... == ... | true | test.c:86:9:86:14 | ExprStmt |
|
||||
| test.c:85:8:85:23 | ... && ... | true | test.c:86:9:86:14 | ExprStmt |
|
||||
| test.c:85:18:85:23 | ... != ... | true | test.c:86:9:86:14 | ExprStmt |
|
||||
| test.c:94:11:94:16 | ... != ... | false | test.c:70:5:70:9 | test2 |
|
||||
| test.c:94:11:94:16 | ... != ... | false | test.c:99:5:102:13 | ExprStmt |
|
||||
| test.c:94:11:94:16 | ... != ... | false | test.c:102:16:102:21 | j |
|
||||
| test.c:94:11:94:16 | ... != ... | false | test.c:102:29:102:26 | { ... } |
|
||||
| test.c:94:11:94:16 | ... != ... | false | test.c:107:5:109:14 | ExprStmt |
|
||||
| test.c:94:11:94:16 | ... != ... | false | test.c:109:19:109:23 | y |
|
||||
| test.c:94:11:94:16 | ... != ... | false | test.c:109:26:117:12 | { ... } |
|
||||
| test.c:94:11:94:16 | ... != ... | false | test.c:113:9:113:16 | return ... |
|
||||
| test.c:94:11:94:16 | ... != ... | true | test.c:94:19:96:11 | { ... } |
|
||||
| test.c:102:16:102:21 | ... < ... | false | test.c:70:5:70:9 | test2 |
|
||||
| test.c:102:16:102:21 | ... < ... | false | test.c:107:5:109:14 | ExprStmt |
|
||||
| test.c:102:16:102:21 | ... < ... | false | test.c:109:19:109:23 | y |
|
||||
| test.c:102:16:102:21 | ... < ... | false | test.c:109:26:117:12 | { ... } |
|
||||
| test.c:102:16:102:21 | ... < ... | false | test.c:113:9:113:16 | return ... |
|
||||
| test.c:102:16:102:21 | ... < ... | true | test.c:102:29:102:26 | { ... } |
|
||||
| test.c:109:9:109:14 | ... == ... | false | test.c:109:19:109:23 | y |
|
||||
| test.c:109:9:109:14 | ... == ... | false | test.c:113:9:113:16 | return ... |
|
||||
| test.c:109:9:109:23 | ... \|\| ... | false | test.c:113:9:113:16 | return ... |
|
||||
| test.c:109:19:109:23 | ... < ... | false | test.c:113:9:113:16 | return ... |
|
||||
| test.c:126:7:126:7 | 1 | true | test.c:126:12:126:26 | call to test3_condition |
|
||||
| test.c:126:7:126:7 | 1 | true | test.c:126:31:128:16 | { ... } |
|
||||
| test.c:126:7:126:7 | 1 | true | test.c:131:3:131:7 | if (...) ... |
|
||||
| test.c:126:7:126:7 | 1 | true | test.c:131:10:132:16 | { ... } |
|
||||
| test.c:126:7:126:7 | 1 | true | test.c:134:1:123:10 | return ... |
|
||||
| test.c:126:7:126:28 | ... && ... | true | test.c:126:31:128:16 | { ... } |
|
||||
| test.c:126:12:126:26 | call to test3_condition | true | test.c:126:31:128:16 | { ... } |
|
||||
| test.c:131:7:131:7 | b | true | test.c:131:10:132:16 | { ... } |
|
||||
| test.c:137:7:137:7 | 0 | false | test.c:142:3:136:10 | return ... |
|
||||
| test.c:146:7:146:8 | ! ... | true | test.c:146:11:147:9 | { ... } |
|
||||
| test.c:146:8:146:8 | x | false | test.c:146:11:147:9 | { ... } |
|
||||
| test.c:152:8:152:8 | p | true | test.c:152:11:154:5 | { ... } |
|
||||
| test.c:158:8:158:9 | ! ... | true | test.c:158:12:160:5 | { ... } |
|
||||
| test.c:158:9:158:9 | p | false | test.c:158:12:160:5 | { ... } |
|
||||
| test.c:164:8:164:8 | s | true | test.c:164:11:166:5 | { ... } |
|
||||
| test.c:170:8:170:9 | ! ... | true | test.c:170:12:172:5 | { ... } |
|
||||
| test.c:170:9:170:9 | s | false | test.c:170:12:172:5 | { ... } |
|
||||
| test.c:176:8:176:15 | ! ... | true | test.c:176:18:178:5 | { ... } |
|
||||
| test.c:176:10:176:14 | ... < ... | false | test.c:176:18:178:5 | { ... } |
|
||||
| test.c:182:8:182:34 | ! ... | true | test.c:182:37:184:5 | { ... } |
|
||||
| test.c:182:10:182:20 | ... >= ... | true | test.c:181:25:182:20 | { ... } |
|
||||
| test.c:182:10:182:20 | ... >= ... | true | test.c:182:25:182:33 | foo |
|
||||
| test.c:182:10:182:33 | ... && ... | false | test.c:182:37:184:5 | { ... } |
|
||||
| test.c:182:10:182:33 | ... && ... | true | test.c:181:25:182:20 | { ... } |
|
||||
| test.c:182:25:182:33 | ... < ... | true | test.c:181:25:182:20 | { ... } |
|
||||
| test.c:190:7:190:8 | ! ... | true | test.c:190:11:192:3 | { ... } |
|
||||
| test.c:190:8:190:8 | c | false | test.c:190:11:192:3 | { ... } |
|
||||
| test.c:198:7:198:8 | ! ... | true | test.c:198:11:200:3 | { ... } |
|
||||
| test.c:198:8:198:8 | b | false | test.c:198:11:200:3 | { ... } |
|
||||
| test.c:206:7:206:8 | ! ... | true | test.c:206:11:208:3 | { ... } |
|
||||
| test.c:206:8:206:8 | c | false | test.c:206:11:208:3 | { ... } |
|
||||
| test.cpp:18:8:18:10 | call to get | true | test.cpp:19:5:19:14 | ExprStmt |
|
||||
| test.cpp:31:7:31:13 | ... == ... | false | test.cpp:30:6:30:16 | doSomething |
|
||||
| test.cpp:31:7:31:13 | ... == ... | false | test.cpp:34:1:34:1 | return ... |
|
||||
| test.cpp:31:7:31:13 | ... == ... | true | test.cpp:30:6:30:16 | doSomething |
|
||||
| test.cpp:31:7:31:13 | ... == ... | true | test.cpp:31:16:32:21 | { ... } |
|
||||
| test.cpp:42:13:42:20 | call to getABool | true | test.cpp:43:9:45:23 | { ... } |
|
||||
| test.cpp:61:10:61:10 | i | Case[0] | test.cpp:62:5:64:12 | case ...: |
|
||||
| test.cpp:61:10:61:10 | i | Case[1] | test.cpp:65:5:66:10 | case ...: |
|
||||
| test.cpp:74:10:74:10 | i | Case[0..10] | test.cpp:75:5:77:12 | case ...: |
|
||||
| test.cpp:74:10:74:10 | i | Case[11..20] | test.cpp:78:5:79:10 | case ...: |
|
||||
| test.cpp:93:6:93:6 | c | true | test.cpp:93:9:94:7 | { ... } |
|
||||
| test.cpp:99:6:99:6 | f | true | test.cpp:99:9:100:7 | { ... } |
|
||||
| test.cpp:105:6:105:14 | ... != ... | true | test.cpp:105:17:106:7 | { ... } |
|
||||
| test.cpp:111:6:111:14 | ... != ... | true | test.cpp:111:17:112:7 | { ... } |
|
||||
| test.cpp:122:9:122:9 | b | true | test.cpp:123:5:125:20 | { ... } |
|
||||
| test.cpp:122:9:122:9 | b | true | test.cpp:125:23:125:29 | return ... |
|
||||
| test.cpp:125:13:125:20 | ! ... | true | test.cpp:125:23:125:29 | return ... |
|
||||
| test.cpp:125:14:125:17 | call to safe | false | test.cpp:125:23:125:29 | return ... |
|
||||
| test.cpp:131:6:131:21 | call to __builtin_expect | true | test.cpp:131:40:132:9 | { ... } |
|
||||
| test.cpp:135:6:135:21 | call to __builtin_expect | true | test.cpp:135:40:136:9 | { ... } |
|
||||
| test.cpp:141:6:141:21 | call to __builtin_expect | true | test.cpp:141:36:142:9 | { ... } |
|
||||
| test.cpp:145:6:145:21 | call to __builtin_expect | true | test.cpp:145:36:146:9 | { ... } |
|
||||
| test.cpp:152:7:152:8 | ! ... | true | test.cpp:152:11:153:9 | { ... } |
|
||||
| test.cpp:152:8:152:8 | b | false | test.cpp:152:11:153:9 | { ... } |
|
||||
| test.cpp:160:7:160:8 | ! ... | true | test.cpp:160:11:162:3 | { ... } |
|
||||
| test.cpp:160:8:160:8 | c | false | test.cpp:160:11:162:3 | { ... } |
|
||||
| test.cpp:168:7:168:8 | ! ... | true | test.cpp:168:11:170:3 | { ... } |
|
||||
| test.cpp:168:8:168:8 | b | false | test.cpp:168:11:170:3 | { ... } |
|
||||
| test.cpp:176:7:176:8 | ! ... | true | test.cpp:176:11:178:3 | { ... } |
|
||||
| test.cpp:176:8:176:8 | c | false | test.cpp:176:11:178:3 | { ... } |
|
||||
| test.cpp:182:6:182:16 | ! ... | false | test.cpp:185:10:188:7 | { ... } |
|
||||
| test.cpp:182:6:182:16 | ! ... | true | test.cpp:182:19:184:7 | { ... } |
|
||||
| test.cpp:182:8:182:9 | b1 | true | test.cpp:181:41:182:9 | { ... } |
|
||||
| test.cpp:182:8:182:9 | b1 | true | test.cpp:182:14:182:15 | b2 |
|
||||
| test.cpp:182:8:182:15 | ... && ... | false | test.cpp:182:19:184:7 | { ... } |
|
||||
| test.cpp:182:8:182:15 | ... && ... | true | test.cpp:181:41:182:9 | { ... } |
|
||||
| test.cpp:182:8:182:15 | ... && ... | true | test.cpp:185:10:188:7 | { ... } |
|
||||
| test.cpp:182:14:182:15 | b2 | true | test.cpp:181:41:182:9 | { ... } |
|
||||
| test.cpp:193:6:193:16 | ! ... | false | test.cpp:197:10:199:7 | { ... } |
|
||||
| test.cpp:193:6:193:16 | ! ... | true | test.cpp:193:19:196:7 | { ... } |
|
||||
| test.cpp:193:8:193:9 | b1 | false | test.cpp:192:40:193:9 | { ... } |
|
||||
| test.cpp:193:8:193:9 | b1 | false | test.cpp:193:14:193:15 | b2 |
|
||||
| test.cpp:193:8:193:15 | ... \|\| ... | false | test.cpp:192:40:193:9 | { ... } |
|
||||
| test.cpp:193:8:193:15 | ... \|\| ... | false | test.cpp:193:19:196:7 | { ... } |
|
||||
| test.cpp:193:8:193:15 | ... \|\| ... | true | test.cpp:197:10:199:7 | { ... } |
|
||||
| test.cpp:193:14:193:15 | b2 | false | test.cpp:192:40:193:9 | { ... } |
|
||||
| test.cpp:211:9:211:15 | ... == ... | true | test.cpp:211:18:212:13 | { ... } |
|
||||
| test.cpp:214:9:214:17 | ... == ... | true | test.cpp:214:20:215:13 | { ... } |
|
||||
| test.cpp:217:9:217:15 | ... == ... | true | test.cpp:217:18:218:13 | { ... } |
|
||||
| test.cpp:220:9:220:14 | ... == ... | true | test.cpp:220:17:221:13 | { ... } |
|
||||
| test.cpp:223:9:223:16 | ... == ... | true | test.cpp:223:19:224:13 | { ... } |
|
||||
| test.cpp:226:9:226:14 | ... == ... | true | test.cpp:226:17:227:13 | { ... } |
|
||||
| test.cpp:229:9:229:14 | ... == ... | true | test.cpp:229:17:230:13 | { ... } |
|
||||
| test.cpp:232:9:232:18 | ... == ... | true | test.cpp:232:21:233:13 | { ... } |
|
||||
| test.cpp:235:9:235:17 | ... == ... | true | test.cpp:235:20:236:13 | { ... } |
|
||||
| test.cpp:238:9:238:17 | ... == ... | true | test.cpp:238:20:239:13 | { ... } |
|
||||
| test.cpp:241:9:241:17 | ... == ... | true | test.cpp:241:22:241:30 | ms |
|
||||
| test.cpp:241:9:241:17 | ... == ... | true | test.cpp:241:35:241:43 | ms |
|
||||
| test.cpp:241:9:241:17 | ... == ... | true | test.cpp:241:46:242:13 | { ... } |
|
||||
| test.cpp:241:9:241:30 | ... && ... | true | test.cpp:241:35:241:43 | ms |
|
||||
| test.cpp:241:9:241:30 | ... && ... | true | test.cpp:241:46:242:13 | { ... } |
|
||||
| test.cpp:241:9:241:43 | ... && ... | true | test.cpp:241:46:242:13 | { ... } |
|
||||
| test.cpp:241:22:241:30 | ... == ... | true | test.cpp:241:35:241:43 | ms |
|
||||
| test.cpp:241:22:241:30 | ... == ... | true | test.cpp:241:46:242:13 | { ... } |
|
||||
| test.cpp:241:35:241:43 | ... == ... | true | test.cpp:241:46:242:13 | { ... } |
|
||||
|
||||
@@ -7,10 +7,6 @@
|
||||
import cpp
|
||||
import semmle.code.cpp.controlflow.Guards
|
||||
|
||||
from GuardCondition guard, AbstractValue value, int start, int end
|
||||
where
|
||||
exists(BasicBlock block |
|
||||
guard.valueControls(block, value) and
|
||||
block.hasLocationInfo(_, start, _, end, _)
|
||||
)
|
||||
select guard, value, start, end
|
||||
from GuardCondition guard, AbstractValue value, BasicBlock block
|
||||
where guard.valueControls(block, value)
|
||||
select guard, value, block
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -8,31 +8,23 @@ import cpp
|
||||
import semmle.code.cpp.controlflow.Guards
|
||||
|
||||
query predicate binary(
|
||||
GuardCondition guard, Expr left, string op, Expr right, int k, int start, int end
|
||||
GuardCondition guard, Expr left, string op, Expr right, int k, BasicBlock block
|
||||
) {
|
||||
exists(BasicBlock block |
|
||||
guard.ensuresLt(left, right, k, block, true) and op = "<"
|
||||
or
|
||||
guard.ensuresLt(left, right, k, block, false) and op = ">="
|
||||
or
|
||||
guard.ensuresEq(left, right, k, block, true) and op = "=="
|
||||
or
|
||||
guard.ensuresEq(left, right, k, block, false) and op = "!="
|
||||
|
|
||||
block.hasLocationInfo(_, start, _, end, _)
|
||||
)
|
||||
guard.ensuresLt(left, right, k, block, true) and op = "<"
|
||||
or
|
||||
guard.ensuresLt(left, right, k, block, false) and op = ">="
|
||||
or
|
||||
guard.ensuresEq(left, right, k, block, true) and op = "=="
|
||||
or
|
||||
guard.ensuresEq(left, right, k, block, false) and op = "!="
|
||||
}
|
||||
|
||||
query predicate unary(GuardCondition guard, Expr left, string op, int k, int start, int end) {
|
||||
exists(BasicBlock block |
|
||||
guard.ensuresLt(left, k, block, true) and op = "<"
|
||||
or
|
||||
guard.ensuresLt(left, k, block, false) and op = ">="
|
||||
or
|
||||
guard.ensuresEq(left, k, block, true) and op = "=="
|
||||
or
|
||||
guard.ensuresEq(left, k, block, false) and op = "!="
|
||||
|
|
||||
block.hasLocationInfo(_, start, _, end, _)
|
||||
)
|
||||
query predicate unary(GuardCondition guard, Expr left, string op, int k, BasicBlock block) {
|
||||
guard.ensuresLt(left, k, block, true) and op = "<"
|
||||
or
|
||||
guard.ensuresLt(left, k, block, false) and op = ">="
|
||||
or
|
||||
guard.ensuresEq(left, k, block, true) and op = "=="
|
||||
or
|
||||
guard.ensuresEq(left, k, block, false) and op = "!="
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user