Skip to content

Commit bea98e6

Browse files
committed
GPU/TPCClusterFinder: Fix out-of-bounds write.
1 parent f2417fb commit bea98e6

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

GPU/GPUTracking/TPCClusterFinder/GPUTPCCFStreamCompaction.cxx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,9 @@ GPUdii() void GPUTPCCFStreamCompaction::Thread<GPUTPCCFStreamCompaction::scanUp>
5555
int32_t iThreadGlobal = get_global_id(0);
5656
int32_t offsetInBlock = work_group_scan_inclusive_add((iThreadGlobal < nElems) ? scanOffset[iThreadGlobal] : 0);
5757

58-
// TODO: This write isn't needed??
59-
scanOffset[iThreadGlobal] = offsetInBlock;
58+
if (iThreadGlobal < nElems) {
59+
scanOffset[iThreadGlobal] = offsetInBlock;
60+
}
6061

6162
int32_t lastThread = nThreads - 1;
6263
if (iThread == lastThread) {

0 commit comments

Comments
 (0)