@@ -303,10 +303,9 @@ execTxWithCov tx = do
303303 if size == 0 then pure Nothing else do
304304 -- IO for making a new vec
305305 vec <- VMut. new size
306- -- We use -1 for opIx to indicate that the location was not covered
307306 forM_ [0 .. size- 1 ] $ \ i -> VMut. write vec i (0 , 0 )
308307 pure $ Just vec
309-
308+
310309 case maybeCovVec of
311310 Nothing -> pure ()
312311 Just vec -> do
@@ -315,14 +314,13 @@ execTxWithCov tx = do
315314 -- bug in another place, investigate.
316315 -- ... this should be fixed now, since we use `codeContract` instead
317316 -- of `contract` for everything; it may be safe to remove this check.
318- when (pc < VMut. length vec) $
317+ when (pc < VMut. length vec) $ do
318+ VMut. modify (fromJust maybeStatsVec) (\ (execQty, revertQty) -> (execQty + 1 , revertQty)) opIx
319319 VMut. read vec pc >>= \ case
320320 (_, depths, results) | depth < 64 && not (depths `testBit` depth) -> do
321321 VMut. write vec pc (opIx, depths `setBit` depth, results `setBit` fromEnum Stop )
322- VMut. modify (fromJust maybeStatsVec) (\ (execQty, revertQty) -> (execQty + 1 , revertQty)) opIx
323322 writeIORef covContextRef (True , Just (vec, pc))
324- (opIx', depths, results) -> do
325- VMut. modify (fromJust maybeStatsVec) (\ (execQty, revertQty) -> (execQty + 1 , revertQty)) opIx'
323+ _ -> do
326324 modifyIORef' covContextRef $ \ (new, _) -> (new, Just (vec, pc))
327325
328326 -- | Get the VM's current execution location
0 commit comments