[PATCH] D89804: [AMDGPU] Fix off by one in assert
Sebastian Neubauer via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 20 09:28:11 PDT 2020
Flakebi created this revision.
Flakebi added a reviewer: critson.
Herald added subscribers: llvm-commits, kerbowa, hiraditya, t-tye, tpr, dstuttard, yaxunl, nhaehnle, jvesely, kzhuravl, arsenm.
Herald added a project: LLVM.
Flakebi requested review of this revision.
Herald added a subscriber: wdng.
D89217 <https://reviews.llvm.org/D89217> did not subtract one when accessing SubRegFromChannelTable in one
place.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D89804
Files:
llvm/lib/Target/AMDGPU/SIRegisterInfo.cpp
Index: llvm/lib/Target/AMDGPU/SIRegisterInfo.cpp
===================================================================
--- llvm/lib/Target/AMDGPU/SIRegisterInfo.cpp
+++ llvm/lib/Target/AMDGPU/SIRegisterInfo.cpp
@@ -99,7 +99,7 @@
if (Width == 0)
continue;
assert((Width - 1) < SubRegFromChannelTable.size());
- assert(Offset < SubRegFromChannelTable[Width].size());
+ assert(Offset < SubRegFromChannelTable[Width - 1].size());
SubRegFromChannelTable[Width - 1][Offset] = Idx;
}
};
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D89804.299384.patch
Type: text/x-patch
Size: 526 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201020/f9d1cd1a/attachment.bin>
More information about the llvm-commits
mailing list