@ -454,7 +454,7 @@ module Make (Opts : Domain_intf.Opts) (Dom : Domain_intf.Dom) = struct
fun pgm stk state block ->
fun pgm stk state block ->
[ % Trace . info
[ % Trace . info
" @[<2>exec term@ \n @[%a@]@ \n %a@] " Dom . pp state Llair . Term . pp block . term ] ;
" @[<2>exec term@ \n @[%a@]@ \n %a@] " Dom . pp state Llair . Term . pp block . term ] ;
Report . step_term block . term ;
Report . step_term block ;
match block . term with
match block . term with
| Switch { key ; tbl ; els } ->
| Switch { key ; tbl ; els } ->
IArray . fold
IArray . fold
@ -491,12 +491,15 @@ module Make (Opts : Domain_intf.Opts) (Dom : Domain_intf.Dom) = struct
| Throw { exc } -> exec_throw stk state block exc
| Throw { exc } -> exec_throw stk state block exc
| Unreachable -> Work . skip
| Unreachable -> Work . skip
let exec_inst : Llair . inst -> Dom . t -> ( Dom . t , Dom . t * Llair . inst ) result
let exec_inst :
=
Llair . block
fun inst state ->
-> Llair . inst
-> Dom . t
-> ( Dom . t , Dom . t * Llair . inst ) result =
fun block inst state ->
[ % Trace . info
[ % Trace . info
" @[<2>exec inst@ \n @[%a@]@ \n %a@] " Dom . pp state Llair . Inst . pp inst ] ;
" @[<2>exec inst@ \n @[%a@]@ \n %a@] " Dom . pp state Llair . Inst . pp inst ] ;
Report . step_inst inst ;
Report . step_inst block inst ;
Dom . exec_inst inst state
Dom . exec_inst inst state
| > function
| > function
| Some state -> Result . Ok state | None -> Result . Error ( state , inst )
| Some state -> Result . Ok state | None -> Result . Error ( state , inst )
@ -513,7 +516,9 @@ module Make (Opts : Domain_intf.Opts) (Dom : Domain_intf.Dom) = struct
block . parent . name )
block . parent . name )
@@ fun () ->
@@ fun () ->
match
match
Iter . fold_result ~ f : exec_inst ( IArray . to_iter block . cmnd ) state
Iter . fold_result ~ f : ( exec_inst block )
( IArray . to_iter block . cmnd )
state
with
with
| Ok state -> exec_term pgm stk state block
| Ok state -> exec_term pgm stk state block
| Error ( state , inst ) ->
| Error ( state , inst ) ->