diff options
| author | kaizhangNV <149626564+kaizhangNV@users.noreply.github.com> | 2025-02-12 15:37:05 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-02-12 13:37:05 -0800 |
| commit | 3f102afe1038882f336dc052a9954811150fa700 (patch) | |
| tree | 9411909bf649eed9724d14226ed07890a0671329 /tests/diagnostics/uninitialized-resource-type.slang.expected | |
| parent | 0fee8c16e25521d13b50427ac6bf87d7f3419b9c (diff) | |
Fix crash when handling uninitialized resource type (#6338)
* Fix crash when handling uninitialized resource type
close #6328.
When declare a var with struct type, if the struct has a resource
type field and it doesn't provide explicit constructor, because
slang won't implicit construct such variable at declare site if user
doesn't explicitly call the initializer list, we should report the
resource type field uninitialized as an error to prevent future possible
crash when legalize any use of such variable.
Diffstat (limited to 'tests/diagnostics/uninitialized-resource-type.slang.expected')
| -rw-r--r-- | tests/diagnostics/uninitialized-resource-type.slang.expected | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/diagnostics/uninitialized-resource-type.slang.expected b/tests/diagnostics/uninitialized-resource-type.slang.expected new file mode 100644 index 000000000..a74d7f9ff --- /dev/null +++ b/tests/diagnostics/uninitialized-resource-type.slang.expected @@ -0,0 +1,9 @@ +result code = -1 +standard error = { +tests/diagnostics/uninitialized-resource-type.slang(40): warning 41016: use of uninitialized variable 'foo' + const let result = process(foo); + ^ +tests/diagnostics/uninitialized-resource-type.slang(40): error 56003: use of uninitialized opaque handle 'Texture2D'. + const let result = process(foo); + ^ +} |
