File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed
Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -323,7 +323,14 @@ fn parse_names_section<'a>(
323323 for IndexedSection ( _, section) in indexed_sections. iter ( ) {
324324 if let wasmparser:: SectionCode :: Custom { name : "name" , .. } = section. code {
325325 for subsection in section. get_name_section_reader ( ) ? {
326- let f = match subsection? {
326+ // We use a rather old version of wasmparser. This is a workaround
327+ // to skip new types of name subsections instead of aborting.
328+ let subsection = if let Ok ( subsection) = subsection {
329+ subsection
330+ } else {
331+ continue ;
332+ } ;
333+ let f = match subsection {
327334 wasmparser:: Name :: Function ( f) => f,
328335 _ => continue ,
329336 } ;
@@ -512,7 +519,13 @@ impl<'a> Parse<'a> for wasmparser::NameSectionReader<'a> {
512519 let mut i = 0 ;
513520 while !self . eof ( ) {
514521 let start = self . original_position ( ) ;
515- let subsection = self . read ( ) ?;
522+ // We use a rather old version of wasmparser. This is a workaround
523+ // to skip new types of name subsections instead of aborting.
524+ let subsection = if let Ok ( subsection) = self . read ( ) {
525+ subsection
526+ } else {
527+ continue ;
528+ } ;
516529 let size = ( self . original_position ( ) - start) as u32 ;
517530 let name = match subsection {
518531 wasmparser:: Name :: Module ( _) => "\" module name\" subsection" ,
You can’t perform that action at this time.
0 commit comments