diff options
| author | Ronan <ro.cailleau@gmail.com> | 2025-04-18 22:03:23 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-04-18 20:03:23 +0000 |
| commit | a597a0358f2c2b8ec1b71b7959861658a2c06ecc (patch) | |
| tree | 877102efaa37819b3f0f15976726099b22aadffa /source/slang | |
| parent | b4af953972fe5425be33dd064d840d12b6c1eb39 (diff) | |
Fixed crash in slang-ir-autodiff-loop-analysis.cpp (#6831)
* Added Dictionary::erase(iterator) and fixed crashing when filtering a dictionary in slang-ir-autodiff-loop-analysis.cpp
* Added Dictionary::removeIf(Predicate)
* Removed Dictionary::erase(it)
---------
Co-authored-by: Julius Ikkala <julius.ikkala@gmail.com>
Diffstat (limited to 'source/slang')
| -rw-r--r-- | source/slang/slang-ir-autodiff-loop-analysis.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/source/slang/slang-ir-autodiff-loop-analysis.cpp b/source/slang/slang-ir-autodiff-loop-analysis.cpp index d4ff631a6..137ab7775 100644 --- a/source/slang/slang-ir-autodiff-loop-analysis.cpp +++ b/source/slang/slang-ir-autodiff-loop-analysis.cpp @@ -252,11 +252,8 @@ void StatementSet::disjunct(StatementSet other) // Remove any insts that don't have a corresponding statement in the other set, // since this effectively means "any". // - for (auto& statement : statements) - { - if (!other.statements.containsKey(statement.first)) - statements.remove(statement.first); - } + statements.removeIf([&](auto const& statement) + { return !other.statements.containsKey(statement.first); }); } void StatementSet::conjunct(StatementSet other) |
