From ac6f04c15995061ebe8e0ddf62ecf7eb979afb65 Mon Sep 17 00:00:00 2001 From: Yong He Date: Wed, 9 Oct 2024 07:35:10 -0700 Subject: 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 --- source/slang/slang-check-decl.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source/slang/slang-check-decl.cpp') 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(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. -- cgit v1.2.3