[llvm] Fix i1 array global crash in NVPTXAsmPrinter. (PR #92506)
Artem Belevich via llvm-commits
llvm-commits at lists.llvm.org
Fri May 17 09:53:31 PDT 2024
================
@@ -1847,9 +1847,13 @@ void NVPTXAsmPrinter::bufferLEByte(const Constant *CPV, int Bytes,
auto AddIntToBuffer = [AggBuffer, Bytes](const APInt &Val) {
size_t NumBytes = (Val.getBitWidth() + 7) / 8;
SmallVector<unsigned char, 16> Buf(NumBytes);
- for (unsigned I = 0; I < NumBytes; ++I) {
+ for (unsigned I = 0; I < NumBytes - 1; ++I) {
----------------
Artem-B wrote:
This could certainly use a comment or two about what's going on, because it's not obvious. At all.
Why exactly are we special casing the last byte?
https://github.com/llvm/llvm-project/pull/92506
More information about the llvm-commits
mailing list