r296387 - UBSan docs: Explicitly mention that `-fsanitize=unsigned-integer-overflow` does not catch UB.

Nico Weber via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 27 13:27:07 PST 2017


Author: nico
Date: Mon Feb 27 15:27:07 2017
New Revision: 296387

URL: http://llvm.org/viewvc/llvm-project?rev=296387&view=rev
Log:
UBSan docs: Explicitly mention that `-fsanitize=unsigned-integer-overflow` does not catch UB.

https://reviews.llvm.org/D27455

Modified:
    cfe/trunk/docs/UndefinedBehaviorSanitizer.rst

Modified: cfe/trunk/docs/UndefinedBehaviorSanitizer.rst
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/docs/UndefinedBehaviorSanitizer.rst?rev=296387&r1=296386&r2=296387&view=diff
==============================================================================
--- cfe/trunk/docs/UndefinedBehaviorSanitizer.rst (original)
+++ cfe/trunk/docs/UndefinedBehaviorSanitizer.rst Mon Feb 27 15:27:07 2017
@@ -117,7 +117,9 @@ Available checks are:
   -  ``-fsanitize=unreachable``: If control flow reaches
      ``__builtin_unreachable``.
   -  ``-fsanitize=unsigned-integer-overflow``: Unsigned integer
-     overflows.
+     overflows. Note that unlike signed integer overflow, unsigned integer
+     is not undefined behavior. However, while it has well-defined semantics,
+     it is often unintentional, so UBSan offers to catch it.
   -  ``-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




More information about the cfe-commits mailing list