summaryrefslogtreecommitdiffstats
path: root/source/slang/slang-ast-type.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/slang/slang-ast-type.cpp')
-rw-r--r--source/slang/slang-ast-type.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/source/slang/slang-ast-type.cpp b/source/slang/slang-ast-type.cpp
index 664c940a8..a84f04a32 100644
--- a/source/slang/slang-ast-type.cpp
+++ b/source/slang/slang-ast-type.cpp
@@ -387,15 +387,19 @@ Val* ArrayExpressionType::_substituteImplOverride(ASTBuilder* astBuilder, Substi
{
int diff = 0;
auto elementType = as<Type>(baseType->substituteImpl(astBuilder, subst, &diff));
- auto arrlen = as<IntVal>(arrayLength->substituteImpl(astBuilder, subst, &diff));
- SLANG_ASSERT(arrlen);
+ IntVal* newArrayLength = nullptr;
+ if (arrayLength)
+ {
+ newArrayLength = as<IntVal>(arrayLength->substituteImpl(astBuilder, subst, &diff));
+ SLANG_ASSERT(newArrayLength);
+ }
if (diff)
{
*ioDiff = 1;
auto rsType = getArrayType(
astBuilder,
elementType,
- arrlen);
+ newArrayLength);
return rsType;
}
return this;