@@ -303,10 +303,9 @@ execTxWithCov tx = do
303
303
if size == 0 then pure Nothing else do
304
304
-- IO for making a new vec
305
305
vec <- VMut. new size
306
- -- We use -1 for opIx to indicate that the location was not covered
307
306
forM_ [0 .. size- 1 ] $ \ i -> VMut. write vec i (0 , 0 )
308
307
pure $ Just vec
309
-
308
+
310
309
case maybeCovVec of
311
310
Nothing -> pure ()
312
311
Just vec -> do
@@ -315,14 +314,13 @@ execTxWithCov tx = do
315
314
-- bug in another place, investigate.
316
315
-- ... this should be fixed now, since we use `codeContract` instead
317
316
-- 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
319
319
VMut. read vec pc >>= \ case
320
320
(_, depths, results) | depth < 64 && not (depths `testBit` depth) -> do
321
321
VMut. write vec pc (opIx, depths `setBit` depth, results `setBit` fromEnum Stop )
322
- VMut. modify (fromJust maybeStatsVec) (\ (execQty, revertQty) -> (execQty + 1 , revertQty)) opIx
323
322
writeIORef covContextRef (True , Just (vec, pc))
324
- (opIx', depths, results) -> do
325
- VMut. modify (fromJust maybeStatsVec) (\ (execQty, revertQty) -> (execQty + 1 , revertQty)) opIx'
323
+ _ -> do
326
324
modifyIORef' covContextRef $ \ (new, _) -> (new, Just (vec, pc))
327
325
328
326
-- | Get the VM's current execution location
0 commit comments