summaryrefslogtreecommitdiff
path: root/source/slang/slang-reflection.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/slang/slang-reflection.cpp')
-rw-r--r--source/slang/slang-reflection.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/source/slang/slang-reflection.cpp b/source/slang/slang-reflection.cpp
index 1316efa5d..23d006b3f 100644
--- a/source/slang/slang-reflection.cpp
+++ b/source/slang/slang-reflection.cpp
@@ -489,7 +489,10 @@ SLANG_API SlangReflectionUserAttribute* spReflectionType_FindUserAttributeByName
if (!type) return 0;
if (auto declRefType = as<DeclRefType>(type))
{
- return findUserAttributeByName(declRefType->getSession(), declRefType->declRef.getDecl(), name);
+ ASTBuilder* astBuilder = declRefType->getASTBuilder();
+ auto globalSession = astBuilder->getGlobalSession();
+
+ return findUserAttributeByName(globalSession, declRefType->declRef.getDecl(), name);
}
return 0;
}