Commit cf415a9
committed
[alpha.webkit.UnretainedLambdaCapturesChecker] Add the support for protectedSelf
This PR adds the support for treating capturing of "self" as safe if the lambda simultaneously
captures "protectedSelf", which is a RetainPtr of "self".
This PR also fixes a bug that the checker wasn't generating a warning when "self" is implicitly
captured. Note when "self" is implicitly captured, we use the lambda's getBeginLoc as a fallback
source location.
In addition, this PR also fixes a bug that the checker wasn't generating warnings for lambda
caotures when ARC is enabled. While ARC protects variables in the stack, it does not
automatically extend the lifetime of a lambda capture. So we now call RetainTypeChecker's
isUnretained with ignoreARC set to true.1 parent fe6bced commit cf415a9
File tree
4 files changed
+73
-11
lines changed- clang
- lib/StaticAnalyzer/Checkers/WebKit
- test/Analysis/Checkers/WebKit
4 files changed
+73
-11
lines changedLines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
147 | 147 | | |
148 | 148 | | |
149 | 149 | | |
150 | | - | |
| 150 | + | |
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
| |||
Lines changed: 48 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| 39 | + | |
39 | 40 | | |
40 | 41 | | |
41 | 42 | | |
| |||
68 | 69 | | |
69 | 70 | | |
70 | 71 | | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
71 | 81 | | |
72 | 82 | | |
73 | 83 | | |
| |||
287 | 297 | | |
288 | 298 | | |
289 | 299 | | |
290 | | - | |
| 300 | + | |
291 | 301 | | |
292 | 302 | | |
293 | 303 | | |
| |||
307 | 317 | | |
308 | 318 | | |
309 | 319 | | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
310 | 326 | | |
311 | 327 | | |
312 | 328 | | |
| |||
315 | 331 | | |
316 | 332 | | |
317 | 333 | | |
318 | | - | |
| 334 | + | |
319 | 335 | | |
320 | 336 | | |
321 | 337 | | |
| |||
330 | 346 | | |
331 | 347 | | |
332 | 348 | | |
333 | | - | |
334 | | - | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
335 | 358 | | |
336 | 359 | | |
337 | 360 | | |
| |||
351 | 374 | | |
352 | 375 | | |
353 | 376 | | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
354 | 383 | | |
355 | 384 | | |
356 | 385 | | |
357 | | - | |
| 386 | + | |
358 | 387 | | |
359 | 388 | | |
360 | 389 | | |
| |||
364 | 393 | | |
365 | 394 | | |
366 | 395 | | |
367 | | - | |
| 396 | + | |
368 | 397 | | |
369 | 398 | | |
370 | | - | |
371 | | - | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
372 | 402 | | |
373 | 403 | | |
374 | 404 | | |
| |||
387 | 417 | | |
388 | 418 | | |
389 | 419 | | |
390 | | - | |
| 420 | + | |
391 | 421 | | |
392 | 422 | | |
393 | 423 | | |
| |||
429 | 459 | | |
430 | 460 | | |
431 | 461 | | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
432 | 466 | | |
433 | 467 | | |
434 | 468 | | |
| |||
445 | 479 | | |
446 | 480 | | |
447 | 481 | | |
448 | | - | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
449 | 487 | | |
450 | 488 | | |
451 | 489 | | |
| |||
Lines changed: 8 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
| 126 | + | |
126 | 127 | | |
127 | 128 | | |
128 | 129 | | |
129 | 130 | | |
130 | 131 | | |
| 132 | + | |
131 | 133 | | |
132 | 134 | | |
133 | 135 | | |
134 | 136 | | |
| 137 | + | |
135 | 138 | | |
136 | 139 | | |
137 | 140 | | |
138 | 141 | | |
| 142 | + | |
139 | 143 | | |
140 | 144 | | |
141 | 145 | | |
| |||
218 | 222 | | |
219 | 223 | | |
220 | 224 | | |
| 225 | + | |
221 | 226 | | |
222 | 227 | | |
223 | 228 | | |
| |||
242 | 247 | | |
243 | 248 | | |
244 | 249 | | |
| 250 | + | |
245 | 251 | | |
246 | 252 | | |
247 | 253 | | |
248 | 254 | | |
249 | 255 | | |
| 256 | + | |
250 | 257 | | |
251 | 258 | | |
252 | 259 | | |
| |||
262 | 269 | | |
263 | 270 | | |
264 | 271 | | |
| 272 | + | |
265 | 273 | | |
266 | 274 | | |
267 | 275 | | |
| |||
Lines changed: 16 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
279 | 279 | | |
280 | 280 | | |
281 | 281 | | |
| 282 | + | |
282 | 283 | | |
283 | 284 | | |
284 | 285 | | |
285 | 286 | | |
286 | 287 | | |
287 | 288 | | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
288 | 294 | | |
289 | 295 | | |
290 | 296 | | |
291 | 297 | | |
| 298 | + | |
292 | 299 | | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
293 | 309 | | |
294 | 310 | | |
295 | 311 | | |
| |||
0 commit comments