diff options
| author | Anders Leino <aleino@nvidia.com> | 2024-11-12 19:46:45 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-11-12 09:46:45 -0800 |
| commit | 567c7e09b6df36b535c4ffbccd6a3658d18e04c2 (patch) | |
| tree | ad29df049844bebf6127a6457baa9030677a697d /source/slang/slang-ir-specialize.cpp | |
| parent | ea04ad12110df6b958c117f5d92f45813316cd70 (diff) | |
Fix two specialization bugs (#5540)
* Fix two specialization bugs
The first bug was introduced in b2ca2d5a4efeae807d3c3f48f60235e47413b559 and ran some
code at scope exit that dereferenced a nullptr context.
The second bug was introduced in bea1394ad35680940a0b69b9c67efc43764cc194 and would cause
the wrong mangled name to be used during specialization.
This closes #5516.
* format code
---------
Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
Diffstat (limited to 'source/slang/slang-ir-specialize.cpp')
| -rw-r--r-- | source/slang/slang-ir-specialize.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/source/slang/slang-ir-specialize.cpp b/source/slang/slang-ir-specialize.cpp index 81ad5ca2a..2757538a6 100644 --- a/source/slang/slang-ir-specialize.cpp +++ b/source/slang/slang-ir-specialize.cpp @@ -2979,7 +2979,7 @@ IRInst* specializeGenericImpl( builder->setInsertBefore(genericVal); List<IRInst*> pendingWorkList; - SLANG_DEFER(for (Index ii = pendingWorkList.getCount() - 1; ii >= 0; ii--) + SLANG_DEFER(for (Index ii = pendingWorkList.getCount() - 1; ii >= 0; ii--) if (context) context->addToWorkList(pendingWorkList[ii]);); // Now we will run through the body of the generic and |
