From 114c9766c2885fc74facf36325a3220cbacc5346 Mon Sep 17 00:00:00 2001 From: Yong He Date: Fri, 3 Jan 2025 14:12:14 -0800 Subject: Create DirectDeclRef when creating Decl to prevent invalid dedup. (#5945) * Create DirectDeclRef when creating Decl to prevent invalid dedup. * Fix test. * fix * update slang-rhi --- source/slang/slang-ast-base.cpp | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'source/slang/slang-ast-base.cpp') diff --git a/source/slang/slang-ast-base.cpp b/source/slang/slang-ast-base.cpp index a1624fcba..ac18da404 100644 --- a/source/slang/slang-ast-base.cpp +++ b/source/slang/slang-ast-base.cpp @@ -23,15 +23,7 @@ void NodeBase::_initDebug(ASTNodeType inAstNodeType, ASTBuilder* inAstBuilder) } DeclRefBase* Decl::getDefaultDeclRef() { - if (auto astBuilder = getCurrentASTBuilder()) - { - const Index currentEpoch = astBuilder->getEpoch(); - if (currentEpoch != m_defaultDeclRefEpoch || !m_defaultDeclRef) - { - m_defaultDeclRef = astBuilder->getOrCreate(this); - m_defaultDeclRefEpoch = currentEpoch; - } - } + SLANG_ASSERT(m_defaultDeclRef); return m_defaultDeclRef; } -- cgit v1.2.3