Repository navigation
Conversation
Collaborator
|
GC patches reworks these, probably not worth to update the code before those patches land. |
Contributor
Author
|
Fair enough. I had a look at #2607: it makes the same change in Happy to leave it to the GC series. The test here covers indexed, named backward and named forward refs in both struct and array, so take it across if it's useful coverage; otherwise this can just be closed. |
This branch has not been deployed
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.
Debug
wat2wasm,--enable-gc:Found while fuzzing the text parser with all features enabled. A struct or array field whose type is a reference, such as
(ref 0),(ref $t)or(ref null $t), reachesParseField. It built the field type withType(type.opt_type()).opt_type()only carries theType::Enum, so the reference index is dropped and the single-argumentType(Enum)constructor asserts. A release build skips the assert and keeps a wrong type (index 0).Every other field and value-type site already routes through
VarToType(ParseGlobalType, the table and elem paths), which keeps the index and defers named references.ParseFieldnow does the same.VarToTypestores a pointer into the field for end-of-module resolution, andParseFieldListcopies each field into a vector, so those pointers are repointed at the stored elements once the vector has stopped growing.Test covers indexed, named backward, named forward, mut and abstract-ref fields in both struct and array.