summaryrefslogtreecommitdiffstats
path: root/llvm/docs/LangRef.rst
diff options
context:
space:
mode:
authorEli Friedman <efriedma@codeaurora.org>2017-02-23 00:48:18 +0000
committerEli Friedman <efriedma@codeaurora.org>2017-02-23 00:48:18 +0000
commit13f2e353110c3523295ed6026622d897f7506bbe (patch)
treefe7f2f41777cf2d069f28d1015c4ee16d49acc1c /llvm/docs/LangRef.rst
parent3b7c7e1d6477f035da49a40755994333e8268a49 (diff)
downloadbcm5719-llvm-13f2e353110c3523295ed6026622d897f7506bbe.tar.gz
bcm5719-llvm-13f2e353110c3523295ed6026622d897f7506bbe.zip
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 llvm-svn: 295916
Diffstat (limited to 'llvm/docs/LangRef.rst')
-rw-r--r--llvm/docs/LangRef.rst6
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/docs/LangRef.rst b/llvm/docs/LangRef.rst
index ce8b6f04ee0..edf95d9b10e 100644
--- a/llvm/docs/LangRef.rst
+++ b/llvm/docs/LangRef.rst
@@ -7734,8 +7734,10 @@ offsets implied by the indices to the base address with infinitely
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
OpenPOWER on IntegriCloud