File tree Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -346,15 +346,14 @@ fn line_info(obj_file: &File<'_>, sections: &mut [ObjSection]) -> Result<()> {
346346 if row. end_sequence ( ) {
347347 // The next row is the start of a new sequence, which means we must
348348 // advance to the next .text section.
349- let section_index = text_sections
350- . next ( )
351- . ok_or_else ( || anyhow ! ( "Next text section not found for line info" ) ) ?
352- . index ( )
353- . 0 ;
354- lines = sections
355- . iter_mut ( )
356- . find ( |s| s. orig_index == section_index)
357- . map ( |s| & mut s. line_info ) ;
349+ let section_index = text_sections. next ( ) . map ( |s| s. index ( ) . 0 ) ;
350+ lines = section_index. map ( |index| {
351+ & mut sections
352+ . iter_mut ( )
353+ . find ( |s| s. orig_index == index)
354+ . unwrap ( )
355+ . line_info
356+ } ) ;
358357 }
359358 }
360359 }
You can’t perform that action at this time.
0 commit comments