summaryrefslogtreecommitdiffstats
path: root/source/slang/lookup.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2018-01-16 15:38:36 -0500
committerYong He <yonghe@outlook.com>2018-01-16 15:38:36 -0500
commita74a5494b34e2b41a294042ab8b3e7bce115dcba (patch)
tree9895842d33893b9a233f58964cfa55b3974d6134 /source/slang/lookup.cpp
parent59691aeeb013c5bb7cdaa31a6fc572eebd8be610 (diff)
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.
Diffstat (limited to 'source/slang/lookup.cpp')
-rw-r--r--source/slang/lookup.cpp7
1 files changed, 7 insertions, 0 deletions
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<ExtensionDecl> 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<InheritanceDecl>(containerDeclRef);
for (auto inheritanceDeclRef : baseInterfaces)
{
+ checkDecl(request.semantics, inheritanceDeclRef.decl);
auto baseType = inheritanceDeclRef.getDecl()->base.type.As<DeclRefType>();
SLANG_ASSERT(baseType);
int diff = 0;