diff options
| author | Yong He <yonghe@outlook.com> | 2024-10-09 07:35:10 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-10-09 22:35:10 +0800 |
| commit | ac6f04c15995061ebe8e0ddf62ecf7eb979afb65 (patch) | |
| tree | f16f0f01f1f8d0e73ecd774a22f87576f440f8e8 /source/slang/slang-check-decl.cpp | |
| parent | bea1394ad35680940a0b69b9c67efc43764cc194 (diff) | |
Fix spirv lowering logic around pointer to unsized array. (#5243)
* Fix spirv lowering logic around pointer to unsized array.
* Fix.
---------
Co-authored-by: Ellie Hermaszewska <ellieh@nvidia.com>
Diffstat (limited to 'source/slang/slang-check-decl.cpp')
| -rw-r--r-- | source/slang/slang-check-decl.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/source/slang/slang-check-decl.cpp b/source/slang/slang-check-decl.cpp index b7f65a11a..5ca1baeec 100644 --- a/source/slang/slang-check-decl.cpp +++ b/source/slang/slang-check-decl.cpp @@ -8430,6 +8430,11 @@ namespace Slang { auto typeExpr = paramDecl->type; + if (!as<ArrayExpressionType>(paramDecl->type) && doesTypeHaveTag(paramDecl->type, TypeTag::Unsized)) + { + getSink()->diagnose(paramDecl, Diagnostics::paramCannotBeUnsized, paramDecl); + } + // The "initializer" expression for a parameter represents // a default argument value to use if an explicit one is // not supplied. |
