Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## Unreleased

**Fixes**

- sourcemapcache: Tokens are now considered to only extend to the end of the line
(as intended). This means that some lookups that would previously (incorrectly)
have returned unminified source positions now return nothing. ([#932](https://github.com/getsentry/symbolic/pull/932))

## 12.16.1

**Fixes**
Expand Down
7 changes: 7 additions & 0 deletions symbolic-sourcemapcache/src/lookup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,13 @@ impl<'data> SourceMapCache<'data> {
Err(idx) => idx - 1,
};

// If the token has a lower minified line number,
// it actually belongs to the previous line. That means it should
// not match.
if self.min_source_positions.get(idx)?.line < sp.line {
return None;
}

let sl = self.orig_source_locations.get(idx)?;

// If file, line, and column are all absent (== `u32::MAX`), this location is simply unmapped.
Expand Down
3 changes: 3 additions & 0 deletions symbolic-sourcemapcache/tests/integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ fn resolves_inlined_function() {
assert_eq!(sl.line(), 1);
assert_eq!(sl.column(), 8);
assert_eq!(sl.scope(), ScopeLookupResult::AnonymousScope);

// There are no mappings for line 1 in the sourcemap.
assert!(cache.lookup(SourcePosition::new(1, 17)).is_none());
}

#[test]
Expand Down
Loading