Remove code_offset; relative to code section?

This commit is contained in:
Chris Fallin 2023-02-13 18:15:38 -08:00
parent df19820693
commit e23d19b03a

View file

@ -373,7 +373,8 @@ impl<'a> DebugLocReader<'a> {
}
fn get_loc(&mut self, offset: usize) -> SourceLoc {
let offset = u32::try_from(offset).unwrap() + self.code_offset;
// TODO: add `code_offset`?
let offset = u32::try_from(offset).unwrap();
while self.locs.len() > 0 {
let (start, len, loc) = self.locs[0];
if offset < start {