Skip to content

DxilFixConstArrayInitializer can index OOB when const array init stores use negative index #6824

Closed

Description

@dneto0

Description
In a debug build, the compiler crashes on this compute shader:

groupshared float4 w;

[numthreads(1, 1, 1)]
void b() {
  int i = -1;
  w[i] = 0;
}

Steps to Reproduce
Compile via: dxc -T cs_6_0 -E b a.hlsl

Actual Behavior
The compiler should not crash.
The shader is doing an OOB access which is undefined behaviour, so it doesn't matter what the resulting shader does.

Environment

  • DXC version: libdxcompiler.so: 1.8(dev;4686-ff5955a4)
  • Host Operating System: Linux x86-64

Activity

  1. added
    bug
    needs-triage
    on Jul 25, 2024
  2. added a commit that references this issue on Jul 25, 2024
    d99015e
  3. added a commit that references this issue on Jul 27, 2024
    9ef0481
  4. added a commit that references this issue on Jul 24, 2025
    88dd572
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugneeds-triage

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions