From a74a5494b34e2b41a294042ab8b3e7bce115dcba Mon Sep 17 00:00:00 2001 From: Yong He Date: Tue, 16 Jan 2018 15:38:36 -0500 Subject: bug fixes to get falcor example shader code to compile. 1. prevent cyclic lookups when an interface inherits transitively from itself. 2. in `createGlobalGenericParamSubstitution`, create a default substitution for the base type declref before using it to lookup the witness table. --- source/slang/lookup.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'source/slang/lookup.cpp') diff --git a/source/slang/lookup.cpp b/source/slang/lookup.cpp index 5f925a1c2..e5ffa00f7 100644 --- a/source/slang/lookup.cpp +++ b/source/slang/lookup.cpp @@ -4,6 +4,8 @@ namespace Slang { +void checkDecl(SemanticsVisitor* visitor, Decl* decl); + // DeclRef ApplyExtensionToType( @@ -224,6 +226,10 @@ void DoLocalLookupImpl( LookupResult& result, BreadcrumbInfo* inBreadcrumbs) { + if (result.lookedupDecls.Contains(containerDeclRef)) + return; + result.lookedupDecls.Add(containerDeclRef); + ContainerDecl* containerDecl = containerDeclRef.getDecl(); // Ensure that the lookup dictionary in the container is up to date @@ -318,6 +324,7 @@ void DoLocalLookupImpl( auto baseInterfaces = getMembersOfType(containerDeclRef); for (auto inheritanceDeclRef : baseInterfaces) { + checkDecl(request.semantics, inheritanceDeclRef.decl); auto baseType = inheritanceDeclRef.getDecl()->base.type.As(); SLANG_ASSERT(baseType); int diff = 0; -- cgit v1.2.3