microsoft / microsoft/DirectXShaderCompiler
DXC Validator doesn't error on out of bounds access at index -1
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 3.7k
- Forks
- 900
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 44
Description
The validator doesn't catch '-1' used as a vector index:
https://hlsl.godbolt.org/z/MoeTbjnz4
Expected behavior:
error: validation errors
:5:10: error: Access to out-of-bounds memory is disallowed.
note: at '%6 = getelementptr [2 x i32], [2 x i32]* %1, i32 0, i32 -1' in block '#0' of function '?foo@@YAHHH@Z'.
Validation failed.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the negative-index vector access using the linked Godbolt HLSL example and inspect the DXC validator path for out-of-bounds access. Done means the case reports the expected validation error instead of accepting index -1; no source file or test is named in the issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100