@@ -296,10 +296,9 @@ execTxWithCov tx = do
296296 if size == 0 then pure Nothing else do
297297 -- IO for making a new vec
298298 vec <- VMut. new size
299- -- We use -1 for opIx to indicate that the location was not covered
300299 forM_ [0 .. size- 1 ] $ \ i -> VMut. write vec i (0 , 0 )
301300 pure $ Just vec
302-
301+
303302 case maybeCovVec of
304303 Nothing -> pure ()
305304 Just vec -> do
@@ -308,14 +307,13 @@ execTxWithCov tx = do
308307 -- bug in another place, investigate.
309308 -- ... this should be fixed now, since we use `codeContract` instead
310309 -- of `contract` for everything; it may be safe to remove this check.
311- when (pc < VMut. length vec) $
310+ when (pc < VMut. length vec) $ do
311+ VMut. modify (fromJust maybeStatsVec) (\ (execQty, revertQty) -> (execQty + 1 , revertQty)) opIx
312312 VMut. read vec pc >>= \ case
313313 (_, depths, results) | depth < 64 && not (depths `testBit` depth) -> do
314314 VMut. write vec pc (opIx, depths `setBit` depth, results `setBit` fromEnum Stop )
315- VMut. modify (fromJust maybeStatsVec) (\ (execQty, revertQty) -> (execQty + 1 , revertQty)) opIx
316315 writeIORef covContextRef (True , Just (vec, pc))
317- (opIx', depths, results) -> do
318- VMut. modify (fromJust maybeStatsVec) (\ (execQty, revertQty) -> (execQty + 1 , revertQty)) opIx'
316+ _ -> do
319317 modifyIORef' covContextRef $ \ (new, _) -> (new, Just (vec, pc))
320318
321319 -- | Get the VM's current execution location
0 commit comments