You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[alpha.webkit.UnretainedCallArgsChecker] Add a checker for NS or CF type call arguments.
This PR adds alpha.webkit.UnretainedCallArgsChecker by generalizing RawPtrRefLocalVarsChecker.
It checks call arguments of NS or CF types are backed by a RetainPtr or not. The new checker
is effective for NS and CF types in Objective-C++ code without ARC, and it's effective for
CF types in code with ARC.
Copy file name to clipboardExpand all lines: clang/docs/analyzer/checkers.rst
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3582,6 +3582,12 @@ The goal of this rule is to make sure that lifetime of any dynamically allocated
3582
3582
3583
3583
The rules of when to use and not to use CheckedPtr / CheckedRef are same as alpha.webkit.UncountedCallArgsChecker for ref-counted objects.
3584
3584
3585
+
alpha.webkit.UnretainedCallArgsChecker
3586
+
"""""""""""""""""""""""""""""""""""""
3587
+
The goal of this rule is to make sure that lifetime of any dynamically allocated NS or CF objects passed as a call argument keeps its memory region past the end of the call. This applies to call to any function, method, lambda, function pointer or functor. NS or CF objects aren't supposed to be allocated on stack so we check arguments for parameters of raw pointers and references to unretained types.
3588
+
3589
+
The rules of when to use and not to use RetainPtr are same as alpha.webkit.UncountedCallArgsChecker for ref-counted objects.
3590
+
3585
3591
alpha.webkit.UncountedLocalVarsChecker
3586
3592
""""""""""""""""""""""""""""""""""""""
3587
3593
The goal of this rule is to make sure that any uncounted local variable is backed by a ref-counted object with lifetime that is strictly larger than the scope of the uncounted local variable. To be on the safe side we require the scope of an uncounted variable to be embedded in the scope of ref-counted object that backs it.
0 commit comments