summaryrefslogtreecommitdiffstats
path: root/source/slang/lookup.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/slang/lookup.cpp')
-rw-r--r--source/slang/lookup.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/source/slang/lookup.cpp b/source/slang/lookup.cpp
index e4ae3c8bb..f74e11016 100644
--- a/source/slang/lookup.cpp
+++ b/source/slang/lookup.cpp
@@ -177,6 +177,11 @@ void DoMemberLookupImpl(
LookupResult& ioResult,
BreadcrumbInfo* breadcrumbs)
{
+ if (!baseType)
+ {
+ return;
+ }
+
// If the type was pointer-like, then dereference it
// automatically here.
if (auto pointerLikeType = baseType->As<PointerLikeType>())
@@ -482,11 +487,14 @@ void DoLookupImpl(
// in the target decl we are extending
if (auto extDeclRef = containerDeclRef.As<ExtensionDecl>())
{
- if (auto targetDeclRef = extDeclRef.getDecl()->targetType->AsDeclRefType())
+ if (extDeclRef.getDecl()->targetType)
{
- if (auto aggDeclRef = targetDeclRef->declRef.As<AggTypeDecl>())
+ if (auto targetDeclRef = extDeclRef.getDecl()->targetType->AsDeclRefType())
{
- containerDeclRef = extDeclRef.Substitute(aggDeclRef);
+ if (auto aggDeclRef = targetDeclRef->declRef.As<AggTypeDecl>())
+ {
+ containerDeclRef = extDeclRef.Substitute(aggDeclRef);
+ }
}
}
}
@@ -703,4 +711,4 @@ LookupResult lookUpMember(
return result;
}
-} \ No newline at end of file
+}