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
Introduce a new WebKit checker for a unchecked call arguments (#113708) (#114522)
This PR introduces alpha.webkit.UncheckedCallArgsChecker which detects a
function argument which is a raw reference or a raw pointer to a
CheckedPtr capable object.
Copy file name to clipboardExpand all lines: clang/docs/analyzer/checkers.rst
+6Lines changed: 6 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -3560,6 +3560,12 @@ We also define a set of safe transformations which if passed a safe value as an
3560
3560
- casts
3561
3561
- unary operators like ``&`` or ``*``
3562
3562
3563
+
alpha.webkit.UncheckedCallArgsChecker
3564
+
"""""""""""""""""""""""""""""""""""""
3565
+
The goal of this rule is to make sure that lifetime of any dynamically allocated CheckedPtr capable object 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. CheckedPtr capable objects aren't supposed to be allocated on stack so we check arguments for parameters of raw pointers and references to unchecked types.
3566
+
3567
+
The rules of when to use and not to use CheckedPtr / CheckedRef are same as alpha.webkit.UncountedCallArgsChecker for ref-counted objects.
3568
+
3563
3569
alpha.webkit.UncountedLocalVarsChecker
3564
3570
""""""""""""""""""""""""""""""""""""""
3565
3571
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