[Analyzer][NFC] Remove prefix from WebKitNoUncountedMemberChecker name

This commit is contained in:
Jan Korous 2020-06-15 13:58:34 -07:00
parent 1d33c09f22
commit a93ff1826b
5 changed files with 8 additions and 8 deletions

View File

@ -1404,9 +1404,9 @@ Ref-counted types hold their ref-countable data by a raw pointer and allow impli
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.
@ -2404,7 +2404,7 @@ Here are some examples of situations that we warn about as they *might* be poten
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.

View File

@ -1625,7 +1625,7 @@ def RefCntblBaseVirtualDtorChecker : Checker<"RefCntblBaseVirtualDtor">,
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>;

View File

@ -145,11 +145,11 @@ public:
};
} // 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;
}

View File

@ -1,6 +1,6 @@
// 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;

View File

@ -1,4 +1,4 @@
// RUN: %clang_analyze_cc1 -analyzer-checker=webkit.WebKitNoUncountedMemberChecker -verify %s
// RUN: %clang_analyze_cc1 -analyzer-checker=webkit.NoUncountedMemberChecker -verify %s
#include "mock-types.h"