summaryrefslogtreecommitdiff
path: root/source/slang/slang-ir-validate.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/slang/slang-ir-validate.cpp')
-rw-r--r--source/slang/slang-ir-validate.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/source/slang/slang-ir-validate.cpp b/source/slang/slang-ir-validate.cpp
index bf1ce1956..d0948fbb1 100644
--- a/source/slang/slang-ir-validate.cpp
+++ b/source/slang/slang-ir-validate.cpp
@@ -336,16 +336,18 @@ namespace Slang
validateIRInstOperands(context, inst);
context->seenInsts.add(inst);
+ if (auto code = as<IRGlobalValueWithCode>(inst))
+ {
+ context->domTree = computeDominatorTree(code);
+ validateCodeBody(context, code);
+ }
+
// If `inst` is itself a parent instruction, then we need to recursively
// validate its children.
validateIRInstChildren(context, inst);
if (auto code = as<IRGlobalValueWithCode>(inst))
- {
- context->domTree = computeDominatorTree(code);
- validateCodeBody(context, code);
context->domTree = nullptr;
- }
}
void validateIRInst(IRInst* inst)