diff options
author | Vedant Kumar <vsk@apple.com> | 2017-08-02 18:10:31 +0000 |
---|---|---|
committer | Vedant Kumar <vsk@apple.com> | 2017-08-02 18:10:31 +0000 |
commit | 63a4e484860278f8a187fea35563d9a0ceed2db1 (patch) | |
tree | 405da97822ee96acf444033a6b8cd654b8e7978d /docs | |
parent | d9009e558ab4d45eefae9d11d24951a61c3bb54b (diff) | |
download | clang-63a4e484860278f8a187fea35563d9a0ceed2db1.tar.gz |
[ubsan] Have -fsanitize=vptr emit a null check if -fsanitize=null isn't available
In r309007, I made -fsanitize=null a hard prerequisite for -fsanitize=vptr. I
did not see the need for the two checks to have separate null checking logic
for the same pointer. I expected the two checks to either always be enabled
together, or to be mutually compatible.
In the mailing list discussion re: r309007 it became clear that that isn't the
case. If a codebase is -fsanitize=vptr clean but not -fsanitize=null clean,
it's useful to have -fsanitize=vptr emit its own null check. That's what this
patch does: with it, -fsanitize=vptr can be used without -fsanitize=null.
Differential Revision: https://reviews.llvm.org/D36112
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@309846 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'docs')
-rw-r--r-- | docs/ReleaseNotes.rst | 4 | ||||
-rw-r--r-- | docs/UndefinedBehaviorSanitizer.rst | 8 |
2 files changed, 5 insertions, 7 deletions
diff --git a/docs/ReleaseNotes.rst b/docs/ReleaseNotes.rst index 49ed87d9a9..08f9b8606d 100644 --- a/docs/ReleaseNotes.rst +++ b/docs/ReleaseNotes.rst @@ -198,9 +198,7 @@ Static Analyzer Undefined Behavior Sanitizer (UBSan) ------------------------------------ -The C++ dynamic type check now requires run-time null checking (i.e, -`-fsanitize=vptr` cannot be used without `-fsanitize=null`). This change does -not impact users who rely on UBSan check groups (e.g `-fsanitize=undefined`). +... Core Analysis Improvements ========================== diff --git a/docs/UndefinedBehaviorSanitizer.rst b/docs/UndefinedBehaviorSanitizer.rst index 6274054a46..aa52f2d155 100644 --- a/docs/UndefinedBehaviorSanitizer.rst +++ b/docs/UndefinedBehaviorSanitizer.rst @@ -132,10 +132,10 @@ Available checks are: - ``-fsanitize=vla-bound``: A variable-length array whose bound does not evaluate to a positive value. - ``-fsanitize=vptr``: Use of an object whose vptr indicates that it is of - the wrong dynamic type, or that its lifetime has not begun or has ended. - Incompatible with ``-fno-rtti`` and ``-fno-sanitize=null``. Link must be - performed by ``clang++``, not ``clang``, to make sure C++-specific parts of - the runtime library and C++ standard libraries are present. + the wrong dynamic type, or that its lifetime has not begun or has ended. + Incompatible with ``-fno-rtti``. Link must be performed by ``clang++``, not + ``clang``, to make sure C++-specific parts of the runtime library and C++ + standard libraries are present. You can also use the following check groups: - ``-fsanitize=undefined``: All of the checks listed above other than |