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

DXC crashes on bad shader register input #6487

Open
damyanp opened this issue Apr 2, 2024 · 1 comment · May be fixed by #7126
Open

DXC crashes on bad shader register input #6487

damyanp opened this issue Apr 2, 2024 · 1 comment · May be fixed by #7126
Assignees
Labels
bug Bug, regression, crash crash DXC crashing or hitting an assert incorrect-code Issues relating to handling of incorrect code
Milestone

Comments

@damyanp
Copy link
Member

damyanp commented Apr 2, 2024

Description

StructuredBuffer<uint> foo : FOO(123);
void main() {} // unneeded

This crashes on latest dxc.

@damyanp damyanp added bug Bug, regression, crash needs-triage Awaiting triage labels Apr 2, 2024
@damyanp damyanp added incorrect-code Issues relating to handling of incorrect code crash DXC crashing or hitting an assert and removed needs-triage Awaiting triage labels Apr 2, 2024
@damyanp damyanp added this to the Dormant milestone Apr 2, 2024
@damyanp damyanp moved this to Triaged in HLSL Triage Apr 2, 2024
@tcorringham
Copy link
Collaborator

A non-null parenthesized list following a semantic is mis-parsed as a direct initializer. When the semantic actions for a direct initializer are performed the type of the initializer is dereferenced - however as a semantic doesn't have a type this results in dereferencing NULLPTR which causes the crash.
As semantics don't accept parameters any parenthesized list following a semantic is an error, and an error diagnostic should be generated.

@tcorringham tcorringham self-assigned this Feb 6, 2025
tcorringham pushed a commit to tcorringham/DirectXShaderCompiler that referenced this issue Feb 6, 2025
A non-null parenthesized list following a semantic was mis-parsed as a
direct initializer. When the semantic actions for a direct initializer
are performed the type of the initializer is dereferenced - however as
a semantic doesn't have a type this resulted in a NULLPTR being
dereferenced which caused a crash.

As semantics don't accept parameters any parenthesized list following
a semantic is an error. We now generate an error diagnostic if a
l-paren follows a semantic.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug, regression, crash crash DXC crashing or hitting an assert incorrect-code Issues relating to handling of incorrect code
Projects
Status: Triaged
Development

Successfully merging a pull request may close this issue.

2 participants