Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No bounds check on matrix access in type constructor #6895

Open
runestubbe opened this issue Sep 4, 2024 · 0 comments
Open

No bounds check on matrix access in type constructor #6895

runestubbe opened this issue Sep 4, 2024 · 0 comments
Labels
bug Bug, regression, crash incorrect-code Issues relating to handling of incorrect code
Milestone

Comments

@runestubbe
Copy link

Description
I noticed that there seems to be no bounds check on matrix access when it is wrapped in a type constructor.

Steps to Reproduce
https://shader-playground.timjones.io/0aaa9f3162e186ce4ce9da1926b93a40

float4x4 M;
float4 PSMain() : SV_TARGET
{
return float4(M[8]);
}

Actual Behavior
I was expecting a compilation error on the out of bounds access M[8]. If I remove the redundant float4() type constructor, it yields a compilation error as expected.

Environment
Shader playground. Trunk (2024-04-29).

@runestubbe runestubbe added bug Bug, regression, crash needs-triage Awaiting triage labels Sep 4, 2024
@damyanp damyanp added incorrect-code Issues relating to handling of incorrect code and removed needs-triage Awaiting triage labels Sep 4, 2024
@damyanp damyanp added this to the Dormant milestone Sep 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug, regression, crash incorrect-code Issues relating to handling of incorrect code
Projects
Status: Triaged
Development

No branches or pull requests

2 participants