Skip to content

Commit

Permalink
[compiler] Avoid out of bounds access.
Browse files Browse the repository at this point in the history
If !isScan, ivs1 is not guaranteed to hold at least two items and we
could fail trying to retrieve ivs1[1] even if the result would be
unused.
  • Loading branch information
hvdijk committed Jan 15, 2025
1 parent ad0d899 commit 0c4c4d0
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1024,7 +1024,9 @@ struct ScheduleGenerator {
mainPreheaderBB = nullptr;
mainExitBB = block;
nextSubgroupIV = ivs1[0];
nextScanIV = ivs1[1];
if (isScan) {
nextScanIV = ivs1[1];
}
}
} else {
mainPreheaderBB = BasicBlock::Create(
Expand Down

0 comments on commit 0c4c4d0

Please sign in to comment.