summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
diff options
context:
space:
mode:
authorErik Desjardins <erikdesjardins@users.noreply.github.com>2024-02-28 00:09:24 -0500
committerErik Desjardins <erikdesjardins@users.noreply.github.com>2024-03-04 09:32:33 -0500
commit8ebd307d2a95840e193ff03aff21c87b5c643ef4 (patch)
treed0a733ea5935ef049ccf91dcb393aa5bb5839c57 /compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
parent7606c13961ddc1174b70638e934df0439b7dc515 (diff)
downloadrust-8ebd307d2a95840e193ff03aff21c87b5c643ef4.tar.gz
rust-8ebd307d2a95840e193ff03aff21c87b5c643ef4.zip
use GEP inbounds for ZST and DST field offsets
For the former, it's fine for `inbounds` offsets to be one-past-the-end,
so it's okay even if the ZST is the last field in the layout:

> The base pointer has an in bounds address of an allocated object,
> which means that it points into an allocated object, or to its end.

https://llvm.org/docs/LangRef.html#getelementptr-instruction

For the latter, even DST fields must always be inside the layout
(or to its end for ZSTs), so using inbounds is also fine there.
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions