diff options
| author | Yong He <yonghe@outlook.com> | 2023-05-30 21:15:55 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-05-30 21:15:55 -0700 |
| commit | 5c28677ff8bb1ab498954795ae3907f3b6c3b03f (patch) | |
| tree | 9056f65b0637a61700cd70c1af84d5b97b8c1b69 /source/slang/slang-ir-validate.cpp | |
| parent | 5e1974e8cad3396a8c4bedfd63c1ad31b82ec8eb (diff) | |
Fix type checking & loop value hoisting (#2907)
* Fix type checking crash in language server.
* Fix loop var hoisting logic.
Fixes #2903.
* fix.
---------
Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'source/slang/slang-ir-validate.cpp')
| -rw-r--r-- | source/slang/slang-ir-validate.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/source/slang/slang-ir-validate.cpp b/source/slang/slang-ir-validate.cpp index 18229c9b6..bf1ce1956 100644 --- a/source/slang/slang-ir-validate.cpp +++ b/source/slang/slang-ir-validate.cpp @@ -144,7 +144,14 @@ namespace Slang auto operandParent = operandValue->getParent(); - if (auto instParentBlock = as<IRBlock>(instParent)) + auto instParentBlock = as<IRBlock>(instParent); + if (!instParentBlock && as<IRDecoration>(inst)) + { + instParent = instParent->getParent(); + instParentBlock = as<IRBlock>(instParent); + } + + if (instParentBlock) { if (auto operandParentBlock = as<IRBlock>(operandParent)) { |
