[llvm] r295916 - Explicitly state the behavior of inbounds with a null pointer.

Eli Friedman via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 22 16:48:18 PST 2017


Author: efriedma
Date: Wed Feb 22 18:48:18 2017
New Revision: 295916

URL: http://llvm.org/viewvc/llvm-project?rev=295916&view=rev
Log:
Explicitly state the behavior of inbounds with a null pointer.

See https://llvm.org/bugs/show_bug.cgi?id=31439; this reflects LLVM's
behavior in practice, and should be compatible with C/C++ rules.

Differential Revision: https://reviews.llvm.org/D28026


Modified:
    llvm/trunk/docs/LangRef.rst

Modified: llvm/trunk/docs/LangRef.rst
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/LangRef.rst?rev=295916&r1=295915&r2=295916&view=diff
==============================================================================
--- llvm/trunk/docs/LangRef.rst (original)
+++ llvm/trunk/docs/LangRef.rst Wed Feb 22 18:48:18 2017
@@ -7734,8 +7734,10 @@ offsets implied by the indices to the ba
 precise signed arithmetic are not an *in bounds* address of that
 allocated object. The *in bounds* addresses for an allocated object are
 all the addresses that point into the object, plus the address one byte
-past the end. In cases where the base is a vector of pointers the
-``inbounds`` keyword applies to each of the computations element-wise.
+past the end. The only *in bounds* address for a null pointer in the
+default address-space is the null pointer itself. In cases where the
+base is a vector of pointers the ``inbounds`` keyword applies to each
+of the computations element-wise.
 
 If the ``inbounds`` keyword is not present, the offsets are added to the
 base address with silently-wrapping two's complement arithmetic. If the




More information about the llvm-commits mailing list