diff options
Diffstat (limited to 'library')
-rw-r--r-- | library/states.ml | 4 | ||||
-rw-r--r-- | library/states.mli | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/library/states.ml b/library/states.ml index b7c66abf5..4619b3b53 100644 --- a/library/states.ml +++ b/library/states.ml @@ -28,12 +28,12 @@ let (extern_state,intern_state) = (* Rollback. *) -let with_heavy_rollback f x = +let with_heavy_rollback f h x = let st = freeze () in try f x with reraise -> - (unfreeze st; raise reraise) + let e = h reraise in (unfreeze st; raise e) let with_state_protection f x = let st = freeze () in diff --git a/library/states.mli b/library/states.mli index 70d139d36..4f114d576 100644 --- a/library/states.mli +++ b/library/states.mli @@ -25,7 +25,7 @@ val unfreeze : state -> unit (** [with_heavy_rollback f x] applies [f] to [x] and restores the state of the whole system as it was before the evaluation if an exception is raised. *) -val with_heavy_rollback : ('a -> 'b) -> 'a -> 'b +val with_heavy_rollback : ('a -> 'b) -> (exn -> exn) -> 'a -> 'b (** [with_state_protection f x] applies [f] to [x] and restores the state of the whole system as it was before the evaluation of f *) |