summaryrefslogtreecommitdiff
path: root/source/slang/slang-ast-base.cpp
diff options
context:
space:
mode:
authorjsmall-nvidia <jsmall@nvidia.com>2023-09-25 11:52:18 -0400
committerGitHub <noreply@github.com>2023-09-25 11:52:18 -0400
commit2e761512add35fc719b5e5f5ef3315577777124c (patch)
treec91f9e02c8f8607ace76ad9a60744fe2cfd8748f /source/slang/slang-ast-base.cpp
parentab04bd0dd7dd6a818bbac8c5fef9372c4f597352 (diff)
Fix for threading issues around global session & epoch ids. (#3232)
* Fix for threading issues around global session & epoch ids. * Make m_epochId atomic for thread visibility.
Diffstat (limited to 'source/slang/slang-ast-base.cpp')
-rw-r--r--source/slang/slang-ast-base.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/source/slang/slang-ast-base.cpp b/source/slang/slang-ast-base.cpp
index 5b4a4ea0c..7fa0a8886 100644
--- a/source/slang/slang-ast-base.cpp
+++ b/source/slang/slang-ast-base.cpp
@@ -23,7 +23,7 @@ void NodeBase::_initDebug(ASTNodeType inAstNodeType, ASTBuilder* inAstBuilder)
DeclRefBase* Decl::getDefaultDeclRef()
{
auto astBuilder = getCurrentASTBuilder();
- if (astBuilder->getEpoch() != m_defaultDeclRefEpoch || !m_defaultDeclRef)
+ if (astBuilder && astBuilder->getEpoch() != m_defaultDeclRefEpoch || !m_defaultDeclRef)
{
m_defaultDeclRef = astBuilder->getOrCreate<DirectDeclRef>(this);
m_defaultDeclRefEpoch = astBuilder->getEpoch();