struct Derived : RefCntblBase { }; // warn
-.. _webkit-WebKitNoUncountedMemberChecker:
+.. _webkit-NoUncountedMemberChecker:
-webkit.WebKitNoUncountedMemberChecker
+webkit.NoUncountedMemberChecker
"""""""""""""""""""""""""""""""""""""
Raw pointers and references to uncounted types can't be used as class members. Only ref-counted types are allowed.
consume(uncounted); // warn
}
-Although we are enforcing member variables to be ref-counted by `webkit.WebKitNoUncountedMemberChecker` any method of the same class still has unrestricted access to these. Since from a caller's perspective we can't guarantee a particular member won't get modified by callee (directly or indirectly) we don't consider values obtained from members safe.
+Although we are enforcing member variables to be ref-counted by `webkit.NoUncountedMemberChecker` any method of the same class still has unrestricted access to these. Since from a caller's perspective we can't guarantee a particular member won't get modified by callee (directly or indirectly) we don't consider values obtained from members safe.
Note: It's likely this heuristic could be made more precise with fewer false positives - for example calls to free functions that don't have any parameter other than the pointer should be safe as the callee won't be able to tamper with the member unless it's a global variable.
HelpText<"Check for any ref-countable base class having virtual destructor.">,
Documentation<HasDocumentation>;
-def WebKitNoUncountedMemberChecker : Checker<"WebKitNoUncountedMemberChecker">,
+def NoUncountedMemberChecker : Checker<"NoUncountedMemberChecker">,
HelpText<"Check for no uncounted member variables.">,
Documentation<HasDocumentation>;
};
} // namespace
-void ento::registerWebKitNoUncountedMemberChecker(CheckerManager &Mgr) {
+void ento::registerNoUncountedMemberChecker(CheckerManager &Mgr) {
Mgr.registerChecker<NoUncountedMemberChecker>();
}
-bool ento::shouldRegisterWebKitNoUncountedMemberChecker(
+bool ento::shouldRegisterNoUncountedMemberChecker(
const CheckerManager &Mgr) {
return true;
}
// regression test for https://bugs.llvm.org/show_bug.cgi?id=46142
-// RUN: %clang_analyze_cc1 -analyzer-checker=webkit.WebKitNoUncountedMemberChecker -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=webkit.NoUncountedMemberChecker -verify %s
// expected-no-diagnostics
class ClassWithoutADefinition;
-// RUN: %clang_analyze_cc1 -analyzer-checker=webkit.WebKitNoUncountedMemberChecker -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=webkit.NoUncountedMemberChecker -verify %s
#include "mock-types.h"