From e23d19b03aec342220154248acfdebf246aba37d Mon Sep 17 00:00:00 2001 From: Chris Fallin Date: Mon, 13 Feb 2023 18:15:38 -0800 Subject: [PATCH] Remove `code_offset`; relative to code section? --- src/frontend.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/frontend.rs b/src/frontend.rs index b58d73b..b86ce8d 100644 --- a/src/frontend.rs +++ b/src/frontend.rs @@ -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 {