Skip to content
This repository has been archived by the owner on Oct 21, 2022. It is now read-only.

handle unknown subsections in the name section #328

Merged
merged 1 commit into from May 24, 2022

Conversation

mangas
Copy link
Contributor

@mangas mangas commented May 19, 2022

Closes #271

@athei
Copy link
Member

athei commented May 20, 2022

Please satisfy the CI. The PR contains a lot of noise by pointless stylistic changes.

@mangas mangas force-pushed the handle-unknown-sections branch 2 times, most recently from 8898190 to ba5922f Compare May 20, 2022 09:12
@mangas
Copy link
Contributor Author

mangas commented May 20, 2022

@athei I think I fixed the remaining ones, can you approve the CI run again please?

@athei
Copy link
Member

athei commented May 20, 2022

This is basically about new subsections in the name section that are not supported are passed through verbatim without parsing?

@athei
Copy link
Member

athei commented May 20, 2022

@athei I think I fixed the remaining ones, can you approve the CI run again please?

Just run cargo +nightly fmt.

@mangas
Copy link
Contributor Author

mangas commented May 20, 2022

@athei I think I fixed the remaining ones, can you approve the CI run again please?

Just run cargo +nightly fmt.

I did, I think my IDE was on the backgroudn reformatting it 😆

@mangas
Copy link
Contributor Author

mangas commented May 20, 2022

This is basically about new subsections in the name section that are not supported are passed through verbatim without parsing?

Correct

@mangas mangas changed the title handle unknown sections handle unknown subsections in the name section May 20, 2022
@mangas
Copy link
Contributor Author

mangas commented May 20, 2022

@athei any other changes needed? 🙏

src/elements/name_section.rs Outdated Show resolved Hide resolved
@mangas mangas force-pushed the handle-unknown-sections branch 2 times, most recently from 6be5cf5 to 9cc9ca2 Compare May 21, 2022 15:13
@mangas mangas requested a review from athei May 21, 2022 15:13
@mangas
Copy link
Contributor Author

mangas commented May 23, 2022

@athei do you think we have enough to merge this PR?

@athei athei requested a review from pepyakin May 23, 2022 11:09
@athei
Copy link
Member

athei commented May 23, 2022

@athei do you think we have enough to merge this PR?

Yes from my point of view. Need another review, though.

@mangas
Copy link
Contributor Author

mangas commented May 23, 2022

Is that from @pepyakin? Anyone else we can ping here?

@pepyakin
Copy link
Contributor

Interesting. According to the wasm spec, this is indeed an incorrect names section.

Apparently, those new items are coming from the extended-name-section proposal.

I guess we can ignore those for now and proceed with merging this PR.

@athei
Copy link
Member

athei commented May 23, 2022

You still need to approve / merge. I can't.

@pepyakin pepyakin merged commit 0e95197 into paritytech:master May 24, 2022
@@ -97,7 +97,12 @@ impl NameSection {
local_names = Some(LocalNameSubsection::deserialize(module, rdr)?);
},

_ => return Err(Error::UnknownNameSubsectionType(subsection_type)),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this error still emitted anywhere? Perhaps would be a cleanup to drop it from the enum.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is a good idea if this is the case.

Copy link
Contributor Author

@mangas mangas May 24, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems like it was only emitted by the code we just removed. Raised #330 to remove it

@mangas mangas deleted the handle-unknown-sections branch May 24, 2022 08:44
@mangas
Copy link
Contributor Author

mangas commented May 24, 2022

@athei @pepyakin thanks for the help so far.

Would be possible to create a new tag with the changes so I can use them in paritytech/wasm-instrument#16?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Name section parsing fails for valid wasm
4 participants