diff options
Diffstat (limited to 'source/slang/slang-ast-type.cpp')
| -rw-r--r-- | source/slang/slang-ast-type.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/source/slang/slang-ast-type.cpp b/source/slang/slang-ast-type.cpp index 1fed2d52a..72f1764df 100644 --- a/source/slang/slang-ast-type.cpp +++ b/source/slang/slang-ast-type.cpp @@ -69,8 +69,8 @@ Type* Type::getCanonicalType() // TODO(tfoley): worry about thread safety here? auto canType = et->createCanonicalType(); et->canonicalType = canType; - - SLANG_ASSERT(et->canonicalType); + if (!et->canonicalType) + return getASTBuilder()->getErrorType(); } return et->canonicalType; } @@ -481,7 +481,9 @@ Type* NamedExpressionType::_createCanonicalTypeOverride() { if (!innerType) innerType = getType(m_astBuilder, declRef); - return innerType->getCanonicalType(); + if (innerType) + return innerType->getCanonicalType(); + return nullptr; } HashCode NamedExpressionType::_getHashCodeOverride() |
