diff options
author | George Burgess IV <george.burgess.iv@gmail.com> | 2016-04-25 19:21:45 +0000 |
---|---|---|
committer | George Burgess IV <george.burgess.iv@gmail.com> | 2016-04-25 19:21:45 +0000 |
commit | 58ebc66e98ff3289b3fd8fcb7ffe21500a3f567d (patch) | |
tree | eb6bfe070c6f3cd258c663f43820f597a93e00bb | |
parent | b1467d1ef0fe13f18c5326cf80056d2f3adf6048 (diff) | |
download | bcm5719-llvm-58ebc66e98ff3289b3fd8fcb7ffe21500a3f567d.tar.gz bcm5719-llvm-58ebc66e98ff3289b3fd8fcb7ffe21500a3f567d.zip |
[Docs] Clarify what the object-size sanitizer does.
Currently, the UBSan docs make it sound like the object-size sanitizer
will only detect out-of-bounds reads/writes. It also catches some
operations that don't necessarily access memory (invalid downcasts,
calls of methods on invalid pointers, ...). This patch adds a note
about this behavior in the docs.
llvm-svn: 267447
-rw-r--r-- | clang/docs/UndefinedBehaviorSanitizer.rst | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/clang/docs/UndefinedBehaviorSanitizer.rst b/clang/docs/UndefinedBehaviorSanitizer.rst index 2a133501dd9..1002729f05d 100644 --- a/clang/docs/UndefinedBehaviorSanitizer.rst +++ b/clang/docs/UndefinedBehaviorSanitizer.rst @@ -92,11 +92,14 @@ Available checks are: parameter which is declared to never be null. - ``-fsanitize=null``: Use of a null pointer or creation of a null reference. - - ``-fsanitize=object-size``: An attempt to use bytes which the - optimizer can determine are not part of the object being - accessed. The sizes of objects are determined using - ``__builtin_object_size``, and consequently may be able to detect - more problems at higher optimization levels. + - ``-fsanitize=object-size``: An attempt to potentially use bytes which + the optimizer can determine are not part of the object being accessed. + This will also detect some types of undefined behavior that may not + directly access memory, but are provably incorrect given the size of + the objects involved, such as invalid downcasts and calling methods on + invalid pointers. These checks are made in terms of + ``__builtin_object_size``, and consequently may be able to detect more + problems at higher optimization levels. - ``-fsanitize=return``: In C++, reaching the end of a value-returning function without returning a value. - ``-fsanitize=returns-nonnull-attribute``: Returning null pointer |