From 7766935322266cb2e01d32e5e2827a6f92bc5078 Mon Sep 17 00:00:00 2001 From: ppedrot Date: Mon, 12 Aug 2013 13:36:34 +0000 Subject: Fixing potentially misused Errors.push. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@16699 85f007b7-540e-0410-9357-904b9bb8a0f7 --- lib/future.ml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'lib') 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 -- cgit v1.2.3