[PATCH] D49042: [LangRef] Clarify alloca of zero bytes.
Eli Friedman via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jul 6 13:56:05 PDT 2018
efriedma created this revision.
efriedma added reviewers: nlopes, hfinkel, sanjoy, rsmith, rjmccall.
Let's be conservative here; it matches what we actually implement, and it should be rare in practice anyway.
Repository:
rL LLVM
https://reviews.llvm.org/D49042
Files:
docs/LangRef.rst
Index: docs/LangRef.rst
===================================================================
--- docs/LangRef.rst
+++ docs/LangRef.rst
@@ -7854,9 +7854,9 @@
'``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:
""""""""
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D49042.154451.patch
Type: text/x-patch
Size: 732 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180706/121091d9/attachment.bin>
More information about the llvm-commits
mailing list