Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hevm: tty: skip null src maps when jumping with shift+n #832

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions src/hevm/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

- Test contracts with no code (e.g. `abstract` contracts) are now skipped
- Replay data for invariant tests is now displayed in a form that does not cause errors when used with `dapp test --replay`
- Stepping through the debugger with `shift + n` now always skips positions in the bytecode that do not have a corresponding position in the solidity source map

## [0.48.1] - 2021-09-08

Expand Down
7 changes: 6 additions & 1 deletion src/hevm/src/EVM/TTY.hs
Original file line number Diff line number Diff line change
Expand Up @@ -838,7 +838,12 @@ isNextSourcePosition
isNextSourcePosition ui vm =
let dapp' = dapp (view uiTestOpts ui)
initialPosition = currentSrcMap dapp' (view uiVm ui)
in currentSrcMap dapp' vm /= initialPosition
currentPosition = currentSrcMap dapp' vm
in (not . isNullPosition $ currentPosition) && (currentPosition /= initialPosition)

isNullPosition :: Maybe SrcMap -> Bool
isNullPosition (Just (SM{..})) = srcMapOffset == -1 && srcMapLength == -1 && srcMapFile == -1
isNullPosition Nothing = True

isNextSourcePositionWithoutEntering
:: UiVmState -> Pred VM
Expand Down