forked from KhronosGroup/SPIRV-Tools
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix rebuilding types with circular references (KhronosGroup#5623). (K…
…hronosGroup#5637) This fixes the problem reported in KhronosGroup#5623 using the observation that if we are re-building a type that already exists in the type pool, we should just return that type. This makes type rebuilding more efficient, and it also prevents the type builder from getting itself into infinite recursion (as reported in this issue). In fixing this, I found a couple of other bugs in the type builder: - When rebuilding an Array type, we were not re-building the element type. This caused stale type references in the rebuilt type. - This bug had not been caught by the test, because the test itself had a bug in it: the test was rebuilding types on top of the same ID (the ID counter was never incremented). Initially, the bug in the test caused a failure with the new logic in the builder because we now return types from the pool directly, which causes a failure when two incompatible types are registered under the same ID. Fixing that issue in the test exposed another bug in the rebuilder: we were not re-building the element type for Array types. This was causing a stale type reference inside Array types which was later caught by the type removal logic in the test.
- Loading branch information
Diego Novillo
authored
Apr 9, 2024
1 parent
ade1f7c
commit 3983d15
Showing
3 changed files
with
79 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters