[LangRef] Clarify alloca of zero bytes.
authorEli Friedman <efriedma@codeaurora.org>
Wed, 11 Jul 2018 00:02:01 +0000 (00:02 +0000)
committerEli Friedman <efriedma@codeaurora.org>
Wed, 11 Jul 2018 00:02:01 +0000 (00:02 +0000)
Let's be conservative here; it matches what we actually implemented, and
it should be rare in practice anyway.

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

llvm-svn: 336744

llvm/docs/LangRef.rst

index 4e70bae..540265e 100644 (file)
@@ -7862,9 +7862,9 @@ memory is automatically released when the function returns. The
 '``alloca``' instruction is commonly used to represent automatic
 variables that must have an address available. When the function returns
 (either with the ``ret`` or ``resume`` instructions), the memory is
-reclaimed. Allocating zero bytes is legal, but the result is undefined.
-The order in which memory is allocated (ie., which way the stack grows)
-is not specified.
+reclaimed. Allocating zero bytes is legal, but the returned pointer may not
+be unique. The order in which memory is allocated (ie., which way the stack
+grows) is not specified.
 
 Example:
 """"""""