diff options
| author | Yong He <yonghe@outlook.com> | 2025-01-03 14:12:14 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-01-03 14:12:14 -0800 |
| commit | 114c9766c2885fc74facf36325a3220cbacc5346 (patch) | |
| tree | 2e7c47843934590a30bd7138515a7054846678b4 /source/slang/slang-ast-base.cpp | |
| parent | 5df3a74af9beb1e31fd1ed7975b4d9949b923126 (diff) | |
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
Diffstat (limited to 'source/slang/slang-ast-base.cpp')
| -rw-r--r-- | source/slang/slang-ast-base.cpp | 10 |
1 files changed, 1 insertions, 9 deletions
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<DirectDeclRef>(this); - m_defaultDeclRefEpoch = currentEpoch; - } - } + SLANG_ASSERT(m_defaultDeclRef); return m_defaultDeclRef; } |
