diff options
| author | ppedrot | 2013-08-12 13:36:34 +0000 |
|---|---|---|
| committer | ppedrot | 2013-08-12 13:36:34 +0000 |
| commit | 7766935322266cb2e01d32e5e2827a6f92bc5078 (patch) | |
| tree | f89a40963c67d0bf5bfd5702fae1a6f670b4a533 /lib | |
| parent | f41f7162a216547b073d4a7f239b14d9379337eb (diff) | |
Fixing potentially misused Errors.push.
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@16699 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/future.ml | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/future.ml b/lib/future.ml index a9a5ee5880..292fd6648a 100644 --- a/lib/future.ml +++ b/lib/future.ml @@ -74,9 +74,11 @@ let compute ~pure c : 'a value = match !c with let data = f () in let state = if pure then None else Some (!freeze ()) in c := Val (data, state); `Val data - with - | NotReady as e -> let e = Errors.push e in `Exn e - | e -> let e = Errors.push e in c := Exn e; `Exn e + with e -> + let e = Errors.push e in + match e with + | NotReady -> `Exn e + | _ -> c := Exn e; `Exn e let force ~pure x = match compute ~pure x with | `Val v -> v |
