summaryrefslogtreecommitdiffstats
path: root/source/slang/slang-ir-validate.cpp
diff options
context:
space:
mode:
authorPankaj Mistry <63069047+pmistryNV@users.noreply.github.com>2024-01-24 13:55:19 -0800
committerGitHub <noreply@github.com>2024-01-24 13:55:19 -0800
commitdd57306d951dbcaf6471659fcd1d2c37738f36d0 (patch)
treece67cd68ce243028947c76e53db314929a1889f2 /source/slang/slang-ir-validate.cpp
parent70f6ae4e0427890bf5674e9cca307356125c5c10 (diff)
IRSPIRVAsmOperandInst instructions may not have IRBlock as the immediate parent. Previously special case was added to handle IRDecoration similarly. Replace this with a common method getBlock that traverses the parent chain till it gets to the Block (#3486)
Fixes bug #3432
Diffstat (limited to 'source/slang/slang-ir-validate.cpp')
-rw-r--r--source/slang/slang-ir-validate.cpp9
1 files changed, 2 insertions, 7 deletions
diff --git a/source/slang/slang-ir-validate.cpp b/source/slang/slang-ir-validate.cpp
index af793bb54..5caa8a66e 100644
--- a/source/slang/slang-ir-validate.cpp
+++ b/source/slang/slang-ir-validate.cpp
@@ -4,6 +4,7 @@
#include "slang-ir.h"
#include "slang-ir-insts.h"
#include "slang-ir-dominators.h"
+#include "slang-ir-util.h"
namespace Slang
{
@@ -144,13 +145,7 @@ namespace Slang
auto operandParent = operandValue->getParent();
- auto instParentBlock = as<IRBlock>(instParent);
- if (!instParentBlock && as<IRDecoration>(inst))
- {
- instParent = instParent->getParent();
- instParentBlock = as<IRBlock>(instParent);
- }
-
+ auto instParentBlock = getBlock(inst);
if (instParentBlock)
{
if (auto operandParentBlock = as<IRBlock>(operandParent))