Skip to content
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

fix: data segment names #286

Merged
merged 2 commits into from
Dec 11, 2024
Merged

Conversation

laptou
Copy link
Contributor

@laptou laptou commented Dec 11, 2024

Data segment names are dropped with a warning if the input binary doesn't have a data count section:

[2024-12-11T18:37:45Z DEBUG walrus::module::types] parsing type section
[2024-12-11T18:37:45Z DEBUG walrus::module::imports] parse import section
[2024-12-11T18:37:45Z DEBUG walrus::module::functions] parse function section
[2024-12-11T18:37:45Z DEBUG walrus::module::tables] parse table section
[2024-12-11T18:37:45Z DEBUG walrus::module::memories] parse memory section
[2024-12-11T18:37:45Z DEBUG walrus::module::globals] parse global section
[2024-12-11T18:38:41Z INFO  wasm_bindgen] hi
[2024-12-11T18:38:43Z DEBUG walrus::module::types] parsing type section
[2024-12-11T18:38:43Z DEBUG walrus::module::imports] parse import section
[2024-12-11T18:38:43Z DEBUG walrus::module::functions] parse function section
[2024-12-11T18:38:43Z DEBUG walrus::module::tables] parse table section
[2024-12-11T18:38:43Z DEBUG walrus::module::memories] parse memory section
[2024-12-11T18:38:43Z DEBUG walrus::module::globals] parse global section
[2024-12-11T18:38:43Z DEBUG walrus::module::exports] parse export section
[2024-12-11T18:38:43Z DEBUG walrus::module::elements] parse element section
[2024-12-11T18:38:43Z DEBUG walrus::module::data] parse data section
[2024-12-11T18:38:43Z DEBUG walrus::module] parsing custom section `__wasm_bindgen_unstable`
[2024-12-11T18:38:43Z DEBUG walrus::module] parsing custom section `.debug_abbrev`
[2024-12-11T18:38:43Z DEBUG walrus::module] parsing custom section `.debug_info`
[2024-12-11T18:38:43Z DEBUG walrus::module] parsing custom section `.debug_ranges`
[2024-12-11T18:38:43Z DEBUG walrus::module] parsing custom section `.debug_str`
[2024-12-11T18:38:43Z DEBUG walrus::module] parsing custom section `.debug_pubnames`
[2024-12-11T18:38:43Z DEBUG walrus::module] parsing custom section `.debug_pubtypes`
[2024-12-11T18:38:43Z DEBUG walrus::module] parsing custom section `.debug_line`
[2024-12-11T18:38:45Z DEBUG walrus::module] parse name section
[2024-12-11T18:38:45Z WARN  walrus::module] in name section: index `0` is out of bounds for data
[2024-12-11T18:38:45Z WARN  walrus::module] in name section: index `1` is out of bounds for data
[2024-12-11T18:38:45Z WARN  walrus::module] in name section: index `2` is out of bounds for data
[2024-12-11T18:38:45Z WARN  walrus::module] in name section: index `3` is out of bounds for data
[2024-12-11T18:38:45Z WARN  walrus::module] in name section: index `4` is out of bounds for data
[2024-12-11T18:38:45Z WARN  walrus::module] in name section: index `5` is out of bounds for data
[2024-12-11T18:38:45Z WARN  walrus::module] in name section: index `6` is out of bounds for data
[2024-12-11T18:38:45Z WARN  walrus::module] in name section: index `7` is out of bounds for data
[2024-12-11T18:38:45Z WARN  walrus::module] in name section: index `8` is out of bounds for data
[2024-12-11T18:38:45Z WARN  walrus::module] in name section: index `9` is out of bounds for data
...
[2024-12-11T18:38:45Z WARN  walrus::module] in name section: index `1125` is out of bounds for data
[2024-12-11T18:38:45Z WARN  walrus::module] in name section: index `1126` is out of bounds for data
[2024-12-11T18:38:45Z WARN  walrus::module] in name section: index `1127` is out of bounds for data
[2024-12-11T18:38:45Z WARN  walrus::module] in name section: index `1128` is out of bounds for data
[2024-12-11T18:38:45Z WARN  walrus::module] in name section: index `1129` is out of bounds for data
[2024-12-11T18:38:45Z WARN  walrus::module] in name section: index `1130` is out of bounds for data
[2024-12-11T18:38:45Z DEBUG walrus::module::producers] parse producers section
[2024-12-11T18:38:45Z DEBUG walrus::module] parsing custom section `target_features`
[2024-12-11T18:38:45Z DEBUG walrus::module::functions] parse code section
[2024-12-11T18:38:46Z DEBUG walrus::module] parse complete
[2024-12-11T18:38:46Z DEBUG walrus::passes::used] starting to calculate used set

This is because the IDs are not updated as the data is being read.

@guybedford guybedford merged commit 5101fb0 into rustwasm:main Dec 11, 2024
8 checks passed
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.

2 participants