diff --git a/src/hevm/CHANGELOG.md b/src/hevm/CHANGELOG.md index 11e13d3d3..048c00754 100644 --- a/src/hevm/CHANGELOG.md +++ b/src/hevm/CHANGELOG.md @@ -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 diff --git a/src/hevm/src/EVM/TTY.hs b/src/hevm/src/EVM/TTY.hs index a2397775f..e8272e36f 100644 --- a/src/hevm/src/EVM/TTY.hs +++ b/src/hevm/src/EVM/TTY.hs @@ -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