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