microsoft / microsoft/DirectXShaderCompiler
Integer vector as enum type causes ICE rather than error
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 3.7k
- Forks
- 900
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 44
Description
Hi, I am using the DXC c++ interface to compile hlsl to spirv. I found an internal compiler crash inside the "Compile" function of DxcCompiler3.
I am using the msvc clang toolchain version 13.0.0 to compile.
I downloaded the latest version of dxc from the repository (dbd8db0e84420e063f6f7da974a32d58aa79b64b).
I can compile other code just fine and i also get error messages for other mistakes in my hlsl.
Here are my used arguments:
-Zpc -spirv -fspv-target-env=vulkan1.1 _o3 -E -T cs_6_0 -HV 2021.
Minimal example that causes the compiler crash (reading illegal memory address, address varies from run to run):
enum EE : uint3 {
E = uint3(0,0,0),
};
I am new to dxc and hlsl and i dont even know if it is legal to use a uint3 as a "Supper" for an enum, but i am sure it should NOT crash when i give a missinput like that.
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
Start with the DxcCompiler3 Compile function and reproduce the crash using the provided compiler arguments and minimal HLSL enum example. Trace the invalid uint3 enum type through compilation; done means the input produces a diagnostic for the invalid enum type instead of an internal compiler crash.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 64/100