diff options
author | Nikita Popov <npopov@redhat.com> | 2023-02-01 14:34:38 +0100 |
---|---|---|
committer | Nikita Popov <npopov@redhat.com> | 2023-02-01 15:14:11 +0100 |
commit | 78f88082de3627ea04501c83a08f52cf1e60b4f7 (patch) | |
tree | a45a995048543c7473631f512ad0fb74caba424b /clang/lib/CodeGen/CodeGenModule.cpp | |
parent | 9c4591d7f3acaa00318900bdba4b4ba26c99c666 (diff) | |
download | llvm-78f88082de3627ea04501c83a08f52cf1e60b4f7.zip llvm-78f88082de3627ea04501c83a08f52cf1e60b4f7.tar.gz llvm-78f88082de3627ea04501c83a08f52cf1e60b4f7.tar.bz2 |
[ConstantFold] Fix incorrect inbounds inference for [0 x T] GEPs
Previously all indices into [0 x T] arrays were considered in
range, which resulted in us incorrectly inferring inbounds for
all GEPs of that form. We should not consider them in range here,
and instead bail out of the rewriting logic (which would divide
by zero).
Do continue to consider 0 always in range, to avoid changing
behavior for zero-index GEPs.
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
0 files changed, 0 insertions, 0 deletions