Skip to content

Support Wasm custom sections parsing and processing #1085

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Jun 24, 2024

Conversation

Robbepop
Copy link
Member

Closes #1084.

Copy link

codecov bot commented Jun 24, 2024

Codecov Report

Attention: Patch coverage is 81.05263% with 18 lines in your changes missing coverage. Please review.

Project coverage is 80.48%. Comparing base (f1f92e4) to head (b66152b).

Files Patch % Lines
crates/wasmi/src/module/parser/streaming.rs 53.33% 7 Missing ⚠️
crates/wasmi/src/module/custom_section.rs 92.72% 4 Missing ⚠️
crates/wasmi/src/engine/config.rs 40.00% 3 Missing ⚠️
crates/wasmi/src/module/mod.rs 0.00% 2 Missing ⚠️
crates/wasmi/src/module/builder.rs 75.00% 1 Missing ⚠️
crates/wasmi/src/module/parser.rs 80.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1085   +/-   ##
=======================================
  Coverage   80.48%   80.48%           
=======================================
  Files         269      270    +1     
  Lines       24998    25080   +82     
=======================================
+ Hits        20119    20186   +67     
- Misses       4879     4894   +15     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Robbepop added 5 commits June 24, 2024 15:24
Now all names and data of all custom sections are stored in a single vector instead of having many small allocations for many custom sections. This is a guard against malicious Wasm inputs with tons of tiny custom sections putting heavy strain on the memory allocator. Also with this implementation Drop can be simpler, only having to deallocate two vectors.
@Robbepop Robbepop merged commit 37ae60d into master Jun 24, 2024
18 checks passed
@Robbepop Robbepop deleted the rf-support-custom-sections branch June 24, 2024 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add way to access unknown custom sections in Module
1 participant