[PATCH] D86643: [LangRef] Memset/memcpy/memmove can take undef/poison pointer if the size is 0
Juneyoung Lee via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 26 11:00:21 PDT 2020
aqjune added inline comments.
================
Comment at: llvm/docs/LangRef.rst:1161
+ specified alignment, behavior is undefined. ``undef`` and ``poison``
+ pointers have alignment 1.
----------------
aqjune wrote:
> jdoerfert wrote:
> > Unsure if this is needed TBH. Might be confusing.
> Would it be better if I move this next to `However, they must still be appropriately aligned.` for a better context?
This sentence was added to clarify this case:
```
ptr = poison
memset(ptr align 1, 0, 0) // UB?
```
Since `memset(ptr, 0, 0)` is equivalent to `memset(ptr align 1, 0, 0)`, making the latter non-UB seemed natural to me.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D86643/new/
https://reviews.llvm.org/D86643
More information about the llvm-commits
mailing list