File tree 2 files changed +9
-0
lines changed 2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -50,6 +50,7 @@ impl ItemsBuilder {
50
50
self . items . insert ( id, item) ;
51
51
52
52
let old_value = self . parsed . insert ( id) ;
53
+ // panic happen as this is call 2 times with 7,
53
54
assert ! (
54
55
old_value,
55
56
"should not parse the same key into multiple items"
Original file line number Diff line number Diff line change @@ -125,12 +125,18 @@ impl<'a> Parse<'a> for wasmparser::ModuleReader<'a> {
125
125
section. get_data_section_reader ( ) ?. parse_items ( items, idx) ?;
126
126
}
127
127
wasmparser:: SectionCode :: DataCount => {
128
+ let msg = "the last iteration of the loop take 7 as id" ;
129
+ dbg ! ( msg, idx) ;
128
130
DataCountSection ( section) . parse_items ( items, idx) ?;
129
131
}
130
132
wasmparser:: SectionCode :: Code | wasmparser:: SectionCode :: Function => {
131
133
unreachable ! ( "unexpected code or function section found" ) ;
132
134
}
133
135
} ;
136
+ if idx == 7 {
137
+ let msg = "At some point just after the debug above this also is 7 so the panic" ;
138
+ dbg ! ( msg, & idx) ;
139
+ }
134
140
let id = Id :: section ( idx) ;
135
141
let added = items. size_added ( ) - start;
136
142
let size = sizes
@@ -799,8 +805,10 @@ impl<'a> Parse<'a> for DataCountSection<'a> {
799
805
) -> Result < ( ) , traits:: Error > {
800
806
let range = self . 0 . range ( ) ;
801
807
let size = ( range. end - range. start ) as u32 ;
808
+ //dbg!("section", &idx);
802
809
let id = Id :: section ( idx) ;
803
810
let name = "\" data count\" section" ;
811
+ //dbg!("YEAH", &id);
804
812
items. add_root ( ir:: Item :: new ( id, name, size, ir:: Misc :: new ( ) ) ) ;
805
813
Ok ( ( ) )
806
814
}
You can’t perform that action at this time.
0 commit comments