summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorVedant Kumar <vsk@apple.com>2017-07-29 00:19:51 +0000
committerVedant Kumar <vsk@apple.com>2017-07-29 00:19:51 +0000
commit081dca929f7dc72b99e53622bff71d21c9519ffb (patch)
tree5a28a96f2b28d6041a91b17ffeacf9255be72d07 /docs
parent8c94133f92df7c2e36e8ac0fa31011f2e54b5f3e (diff)
downloadclang-081dca929f7dc72b99e53622bff71d21c9519ffb.tar.gz
[ubsan] Diagnose invalid uses of builtins (clang)
On some targets, passing zero to the clz() or ctz() builtins has undefined behavior. I ran into this issue while debugging UB in __hash_table from libcxx: the bug I was seeing manifested itself differently under -O0 vs -Os, due to a UB call to clz() (see: libcxx/r304617). This patch introduces a check which can detect UB calls to builtins. llvm.org/PR26979 Differential Revision: https://reviews.llvm.org/D34590 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@309459 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'docs')
-rw-r--r--docs/UndefinedBehaviorSanitizer.rst1
1 files changed, 1 insertions, 0 deletions
diff --git a/docs/UndefinedBehaviorSanitizer.rst b/docs/UndefinedBehaviorSanitizer.rst
index 95c3ebfaca..6274054a46 100644
--- a/docs/UndefinedBehaviorSanitizer.rst
+++ b/docs/UndefinedBehaviorSanitizer.rst
@@ -75,6 +75,7 @@ Available checks are:
of a misaligned reference.
- ``-fsanitize=bool``: Load of a ``bool`` value which is neither
``true`` nor ``false``.
+ - ``-fsanitize=builtin``: Passing invalid values to compiler builtins.
- ``-fsanitize=bounds``: Out of bounds array indexing, in cases
where the array bound can be statically determined.
- ``-fsanitize=enum``: Load of a value of an enumerated type which