summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--source/slang/slang-check-impl.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/source/slang/slang-check-impl.h b/source/slang/slang-check-impl.h
index bc265b1b4..623f18b22 100644
--- a/source/slang/slang-check-impl.h
+++ b/source/slang/slang-check-impl.h
@@ -44,8 +44,10 @@ namespace Slang
{
if (auto elemCount = as<ConstantIntVal>(vectorType->elementCount))
{
- auto elemBasicType = as<BasicExpressionType>(vectorType->elementType);
- return makeBasicTypeKey(elemBasicType->baseType, elemCount->value);
+ if( auto elemBasicType = as<BasicExpressionType>(vectorType->elementType) )
+ {
+ return makeBasicTypeKey(elemBasicType->baseType, elemCount->value);
+ }
}
}
else if (auto matrixType = as<MatrixExpressionType>(typeIn))
@@ -54,8 +56,10 @@ namespace Slang
{
if (auto elemCount2 = as<ConstantIntVal>(matrixType->getColumnCount()))
{
- auto elemBasicType = as<BasicExpressionType>(matrixType->getElementType());
- return makeBasicTypeKey(elemBasicType->baseType, elemCount1->value, elemCount2->value);
+ if( auto elemBasicType = as<BasicExpressionType>(matrixType->getElementType()) )
+ {
+ return makeBasicTypeKey(elemBasicType->baseType, elemCount1->value, elemCount2->value);
+ }
}
}
}