Skip to content

[Backport to 14] Fix out of bounds access in SPIRVToOCLBase::mutateArgsForImageOperands#1551

Merged
svenvh merged 1 commit intoKhronosGroup:llvm_release_140from
svenvh:cherry-14
Jul 14, 2022
Merged

[Backport to 14] Fix out of bounds access in SPIRVToOCLBase::mutateArgsForImageOperands#1551
svenvh merged 1 commit intoKhronosGroup:llvm_release_140from
svenvh:cherry-14

Conversation

@svenvh
Copy link
Member

@svenvh svenvh commented Jul 14, 2022

When called from visitCallSPIRVImageReadBuiltIn, Args only has three
elements and ImOpArgIndex is 2. This has been causing this function to
"update" an argument past the end of the vector, which caused a crash
when running transcoding/image_signedness.ll on Windows because the
debug build in Windows has bounds checking on std::vector.

With this change, it should update the correct (and not past the end)
argument instead and satisfy the Windows bounds checks.

(cherry picked from commit 6904b38)

When called from visitCallSPIRVImageReadBuiltIn, Args only has three
elements and ImOpArgIndex is 2. This has been causing this function to
"update" an argument past the end of the vector, which caused a crash
when running transcoding/image_signedness.ll on Windows because the
debug build in Windows has bounds checking on std::vector.

With this change, it should update the correct (and not past the end)
argument instead and satisfy the Windows bounds checks.

(cherry picked from commit 6904b38)
@svenvh svenvh merged commit 2e9f126 into KhronosGroup:llvm_release_140 Jul 14, 2022
@svenvh svenvh deleted the cherry-14 branch July 14, 2022 10:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants