Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ir/ir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ impl ItemsBuilder {
self.items.insert(id, item);

let old_value = self.parsed.insert(id);
// panic happen as this is call 2 times with 7,
assert!(
old_value,
"should not parse the same key into multiple items"
Expand Down
8 changes: 8 additions & 0 deletions parser/wasm_parse/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,12 +125,18 @@ impl<'a> Parse<'a> for wasmparser::ModuleReader<'a> {
section.get_data_section_reader()?.parse_items(items, idx)?;
}
wasmparser::SectionCode::DataCount => {
let msg = "the last iteration of the loop take 7 as id";
dbg!(msg, idx);
DataCountSection(section).parse_items(items, idx)?;
}
wasmparser::SectionCode::Code | wasmparser::SectionCode::Function => {
unreachable!("unexpected code or function section found");
}
};
if idx == 7 {
let msg = "At some point just after the debug above this also is 7 so the panic";
dbg!(msg, &idx);
}
let id = Id::section(idx);
let added = items.size_added() - start;
let size = sizes
Expand Down Expand Up @@ -799,8 +805,10 @@ impl<'a> Parse<'a> for DataCountSection<'a> {
) -> Result<(), traits::Error> {
let range = self.0.range();
let size = (range.end - range.start) as u32;
//dbg!("section", &idx);
let id = Id::section(idx);
let name = "\"data count\" section";
//dbg!("YEAH", &id);
items.add_root(ir::Item::new(id, name, size, ir::Misc::new()));
Ok(())
}
Expand Down