diff options
| author | ArielG-NV <159081215+ArielG-NV@users.noreply.github.com> | 2024-07-19 14:52:25 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-07-19 11:52:25 -0700 |
| commit | 4ae58a720e6f8d63ff5c74fd14f630137dfd0c0c (patch) | |
| tree | 25d3e4813d0cbd25090cef9870b36f3c6930483a /tests | |
| parent | f114433debfba67cbe1db239b6e92278d41ed438 (diff) | |
Fix for invalid swizzle causing crash (#4690)
* Fix for invalid swizzle causing crash
Fixes #4689
If swizzle code is provided 5+ element swizzle the checkSwizzleExpr code will do an out of bounds array access and crash.
* switch test to check for to ensure no crash
* cleanup swizzle errors to only emit once
---------
Co-authored-by: Yong He <yonghe@outlook.com>
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/bugs/invalid-swizzle-count.slang | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/bugs/invalid-swizzle-count.slang b/tests/bugs/invalid-swizzle-count.slang new file mode 100644 index 000000000..811cf6f44 --- /dev/null +++ b/tests/bugs/invalid-swizzle-count.slang @@ -0,0 +1,11 @@ +//TEST:SIMPLE(filecheck=CHECK): -target spirv -stage compute -entry computeMain -emit-spirv-directly +// CHECK: error 30052 +// CHECK-NOT: error 30052 +RWStructuredBuffer<float> outputBuffer; + +[numthreads(1,1,1)] +void computeMain( uint2 dispatchThreadID : SV_DispatchThreadID ) +{ + float4 vecVal = float4(0); + outputBuffer[0] = vecVal.xxtyxx; +} |
