@@ -2324,6 +2324,15 @@ data FrameResult
2324
2324
| FrameErrored EvmError -- ^ Any other error
2325
2325
deriving Show
2326
2326
2327
+ finishAllFramesAndStop :: VMOps t => EVM t s ()
2328
+ finishAllFramesAndStop = do
2329
+ vm <- get
2330
+ case vm. frames of
2331
+ [] -> finishFrame (FrameReturned mempty )
2332
+ _ -> do
2333
+ finishFrame (FrameReturned mempty )
2334
+ finishAllFramesAndStop
2335
+
2327
2336
-- | This function defines how to pop the current stack frame in either of
2328
2337
-- the ways specified by 'FrameResult'.
2329
2338
--
@@ -2518,8 +2527,7 @@ copyBytesToMemory bs size srcOffset memOffset =
2518
2527
assign (# state % # memory) $
2519
2528
SymbolicMemory $ copySlice srcOffset memOffset size bs buf
2520
2529
SymbolicMemory mem ->
2521
- assign (# state % # memory) $
2522
- SymbolicMemory $ copySlice srcOffset memOffset size bs mem
2530
+ assign (# state % # memory) $ SymbolicMemory $ copySlice srcOffset memOffset size bs mem
2523
2531
2524
2532
copyCallBytesToMemory
2525
2533
:: Expr Buf -> Expr EWord -> Expr EWord -> EVM t s ()
@@ -3022,9 +3030,9 @@ instance VMOps Symbolic where
3022
3030
Just concVals -> do
3023
3031
assign # result Nothing
3024
3032
case (length concVals) of
3025
- -- zero solutions means that we are in a branch that's not possible. Revert.
3026
- -- TODO: stop execution of the EVM completely
3027
- 0 -> finishFrame ( FrameReverted ( ConcreteBuf " " ))
3033
+ -- zero solutions means that we are in a branch that's not possible
3034
+ -- so revert all frames and stop all execution on this branch
3035
+ 0 -> finishAllFramesAndStop
3028
3036
1 -> do
3029
3037
let val = head concVals
3030
3038
assign # result Nothing
0 commit comments