[clang] [llvm] [SemaHLSL] Correct descriptor range overflow validation (PR #159475)

Tex Riddell via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 17 17:49:14 PDT 2025


================
@@ -141,4 +141,8 @@ void append_offset_overflow_signature() {}
 
 // expected-error at +1 {{descriptor range offset overflows [4294967292, 4294967296]}}
 [RootSignature("DescriptorTable(CBV(b0, offset = 4294967292, numDescriptors = 5))")]
-void offset_() {}
+void offset_overflow() {}
+
+// expected-error at +1 {{descriptor range offset overflows [4294967295, 4294967296]}}
+[RootSignature("DescriptorTable(CBV(b0, offset = 4294967294), CBV(b1, numDescriptors = 2))")]
+void appended_offset_overflow() {}
----------------
tex3d wrote:

You'll want another test for the gap I think I noticed:
```hlsl
// expected-error at +1 {{descriptor range offset overflows [4294967296, 4294967296]}}
[RootSignature("DescriptorTable(CBV(b0, offset = 4294967294), CBV(b1), CBV(b2))")]
void appended_offset_overflow2() {}
```

https://github.com/llvm/llvm-project/pull/159475


More information about the llvm-commits mailing list