File tree 2 files changed +8
-4
lines changed
2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -177,7 +177,7 @@ impl Module {
177
177
pub ( crate ) fn parse_data (
178
178
& mut self ,
179
179
section : wasmparser:: DataSectionReader ,
180
- ids : & IndicesToIds ,
180
+ ids : & mut IndicesToIds ,
181
181
) -> Result < ( ) > {
182
182
log:: debug!( "parse data section" ) ;
183
183
let preallocated = self . data . arena . len ( ) > 0 ;
@@ -189,12 +189,16 @@ impl Module {
189
189
let id = if preallocated {
190
190
ids. get_data ( i as u32 ) ?
191
191
} else {
192
- self . data . arena . alloc_with_id ( |id| Data {
192
+ let id = self . data . arena . alloc_with_id ( |id| Data {
193
193
id,
194
194
value : Vec :: new ( ) ,
195
195
kind : DataKind :: Passive ,
196
196
name : None ,
197
- } )
197
+ } ) ;
198
+
199
+ ids. push_data ( id) ;
200
+
201
+ id
198
202
} ;
199
203
let data = self . data . get_mut ( id) ;
200
204
Original file line number Diff line number Diff line change @@ -167,7 +167,7 @@ impl Module {
167
167
validator
168
168
. data_section ( & s)
169
169
. context ( "failed to parse data section" ) ?;
170
- ret. parse_data ( s, & indices) ?;
170
+ ret. parse_data ( s, & mut indices) ?;
171
171
}
172
172
Payload :: TypeSection ( s) => {
173
173
validator
You can’t perform that action at this time.
0 commit comments