summaryrefslogtreecommitdiffstats
path: root/source/slang/slang-check-expr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/slang/slang-check-expr.cpp')
-rw-r--r--source/slang/slang-check-expr.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/source/slang/slang-check-expr.cpp b/source/slang/slang-check-expr.cpp
index 3414c16b5..8f24ec5b0 100644
--- a/source/slang/slang-check-expr.cpp
+++ b/source/slang/slang-check-expr.cpp
@@ -1401,7 +1401,15 @@ namespace Slang
Expr* SemanticsVisitor::CheckTerm(Expr* term)
{
+ // If we have already checked the expr, don't check again.
+ if (term->checked)
+ {
+ return term;
+ }
+
auto checkedTerm = _CheckTerm(term);
+ checkedTerm->checked = true;
+
// Differentiable type checking.
// TODO: This can be super slow.
if (this->m_parentFunc &&