Skip to content

Commit 13f2e35

Browse files
author
Eli Friedman
committedFeb 23, 2017
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
1 parent 3b7c7e1 commit 13f2e35

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed
 

‎llvm/docs/LangRef.rst

+4-2
Original file line numberDiff line numberDiff line change
@@ -7734,8 +7734,10 @@ offsets implied by the indices to the base address with infinitely
77347734
precise signed arithmetic are not an *in bounds* address of that
77357735
allocated object. The *in bounds* addresses for an allocated object are
77367736
all the addresses that point into the object, plus the address one byte
7737-
past the end. In cases where the base is a vector of pointers the
7738-
``inbounds`` keyword applies to each of the computations element-wise.
7737+
past the end. The only *in bounds* address for a null pointer in the
7738+
default address-space is the null pointer itself. In cases where the
7739+
base is a vector of pointers the ``inbounds`` keyword applies to each
7740+
of the computations element-wise.
77397741

77407742
If the ``inbounds`` keyword is not present, the offsets are added to the
77417743
base address with silently-wrapping two's complement arithmetic. If the

0 commit comments

Comments
 (0)
Please sign in to comment.