fix: correct ComponentTypeRef tag constant (0x03 not 0x04)#67
Merged
Conversation
The count_type_imports_in_section function used 0x04 for the Type
tag in ComponentTypeRef, but the component model binary format spec
defines Type as externdesc 0x03 (0x04 is Component).
This caused count_replayed_types to undercount when a component has
Type imports (e.g., `use my:inline/foo.{msg}`), making the P2 wrapper
assign resource type operations to the wrong type index.
Fixes the `with` fixture's "type index N is not a resource type" error
(one of two bugs — the other is a cross-memory string copy issue).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Wrong binary format constant:
count_type_imports_in_sectionused 0x04 (Component) instead of 0x03 (Type) for the ComponentTypeRef tag. This causedcount_replayed_typesto undercount when a component has Type imports, making resource operations point to wrong type indices.Fixes the
withfixture's invalid component error. A second bug (cross-memory string copy) remains.Test plan