From de088beee82a68d070f4f92602d71ab29aee5d55 Mon Sep 17 00:00:00 2001 From: KyleMiles Date: Fri, 4 Aug 2023 18:15:52 -0400 Subject: DWARF Import : Fix crash / Bandaid fix for #4547 --- rust/examples/dwarf/dwarf_import/src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'rust/examples') diff --git a/rust/examples/dwarf/dwarf_import/src/lib.rs b/rust/examples/dwarf/dwarf_import/src/lib.rs index f7c29269..e4f8a994 100644 --- a/rust/examples/dwarf/dwarf_import/src/lib.rs +++ b/rust/examples/dwarf/dwarf_import/src/lib.rs @@ -47,7 +47,7 @@ fn recover_names>( ) -> usize { let mut total_die_count = 0; let mut iter = dwarf.units(); - while let Some(header) = iter.next().unwrap() { + while let Ok(Some(header)) = iter.next() { let unit = dwarf.unit(header).unwrap(); let mut namespace_qualifiers: Vec<(isize, CString)> = vec![]; let mut entries = unit.entries(); @@ -236,7 +236,7 @@ fn parse_dwarf( // Parse all the compilation units let mut iter = dwarf.units(); - while let Some(header) = iter.next().unwrap() { + while let Ok(Some(header)) = iter.next() { parse_unit( &dwarf, &dwarf.unit(header).unwrap(), -- cgit v1.3.1