summaryrefslogtreecommitdiffstats
path: root/source/slang/slang-check-expr.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2023-03-29 17:05:07 -0700
committerGitHub <noreply@github.com>2023-03-29 17:05:07 -0700
commit082c48d96c5f8f6b4f560d705fe731da14409cb4 (patch)
treefe9860aea3326cd321365bc5530a917fcef94718 /source/slang/slang-check-expr.cpp
parenta862f5b7007ef50b5def30506f0cea138b73c710 (diff)
Update checkpoint policy to make obvious recompute decisions. (#2753)
* Update checkpoint policy to make obvious recompute decisions. Also adds an optimization to fold updateElement chains on the same array or struct into a single makeArray or makeStruct. * Bug fixes around array types with different int typed count. * change test. * Fix. --------- Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'source/slang/slang-check-expr.cpp')
-rw-r--r--source/slang/slang-check-expr.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/source/slang/slang-check-expr.cpp b/source/slang/slang-check-expr.cpp
index cfcb15269..a14ed38d8 100644
--- a/source/slang/slang-check-expr.cpp
+++ b/source/slang/slang-check-expr.cpp
@@ -1546,7 +1546,12 @@ namespace Slang
// it is possible that we are referring to a generic value param
if (auto declRefExpr = expr.as<DeclRefExpr>())
{
- auto declRef = getDeclRef(m_astBuilder, declRefExpr);
+ auto checkedExpr = as<DeclRefExpr>(CheckTerm(expr.getExpr()));
+ if (!checkedExpr)
+ return nullptr;
+
+ SubstExpr<DeclRefExpr> substExpr(checkedExpr, expr.getSubsts());
+ auto declRef = getDeclRef(m_astBuilder, substExpr);
if (auto genericValParamRef = declRef.as<GenericValueParamDecl>())
{