Skip to content

Commit

Permalink
Review comments: Skip bad ranges but keep going
Browse files Browse the repository at this point in the history
  • Loading branch information
jameysharp committed May 24, 2024
1 parent 0037110 commit f88c46e
Showing 1 changed file with 3 additions and 15 deletions.
18 changes: 3 additions & 15 deletions src/read/rnglists.rs
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,7 @@ impl<R: Reader> RngListIter<R> {
}
};

if range.begin == tombstone {
if range.begin == tombstone || range.begin > range.end {
return Ok(None);
}

Expand Down Expand Up @@ -1397,13 +1397,7 @@ mod tests {
debug_addr_base,
)
.unwrap();
assert_eq!(
ranges.next(),
Ok(Some(Range {
begin: 0x0102_0000,
end: 0x0101_0000
}))
);
assert_eq!(ranges.next(), Ok(None));

// An invalid range after wrapping.
let mut ranges = rnglists
Expand All @@ -1415,13 +1409,7 @@ mod tests {
debug_addr_base,
)
.unwrap();
assert_eq!(
ranges.next(),
Ok(Some(Range {
begin: 0x0102_0000,
end: 0x0001_0000
}))
);
assert_eq!(ranges.next(), Ok(None));

// An invalid offset.
match rnglists.ranges(
Expand Down

0 comments on commit f88c46e

Please sign in to comment.