Skip to content

Commit

Permalink
fix srcMapCodePos
Browse files Browse the repository at this point in the history
  • Loading branch information
samalws-tob committed Apr 11, 2023
1 parent e3e36cc commit d4010ad
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed

- The `prank` cheatcode now transfers value from the correct address
- Fixed an off-by-one error in `EVM.Debug.srcMapCodePos`

## [0.50.4] - 2023-03-17

Expand Down
2 changes: 1 addition & 1 deletion src/EVM/Debug.hs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ srcMapCodePos :: SourceCache -> SrcMap -> Maybe (Text, Int)
srcMapCodePos cache sm =
fmap (second f) $ cache.files ^? ix sm.file
where
f v = ByteString.count 0xa (ByteString.take (sm.offset - 1) v) + 1
f v = ByteString.count 0xa (ByteString.take sm.offset v) + 1

srcMapCode :: SourceCache -> SrcMap -> Maybe ByteString
srcMapCode cache sm =
Expand Down

0 comments on commit d4010ad

Please sign in to comment.