diff options
| author | Pierre-Marie Pédrot | 2014-02-02 17:59:39 +0100 |
|---|---|---|
| committer | Pierre-Marie Pédrot | 2014-02-02 18:00:16 +0100 |
| commit | 2800a82dec607120fd2a378f7ac3bf4d6e8df18c (patch) | |
| tree | 3c705ce344052c3849e39a4394326ee593e5b434 /bootstrap | |
| parent | e307d0ae873b8b104b9b7cc3bcd538e5faa8456e (diff) | |
Fixing backtrace reporting.
Diffstat (limited to 'bootstrap')
| -rw-r--r-- | bootstrap/Monads.v | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/bootstrap/Monads.v b/bootstrap/Monads.v index b4935cc680..a160aaa87e 100644 --- a/bootstrap/Monads.v +++ b/bootstrap/Monads.v @@ -213,7 +213,12 @@ Module IOBase. Extract Constant raise => "fun e -> (); fun () -> raise (Proof_errors.Exception e)". Extraction Implicit raise [A]. Parameter catch : forall A, T A -> (Exception -> T A) -> T A. - Extract Constant catch => "fun s h -> (); fun () -> try s () with Proof_errors.Exception e -> let e = Errors.push e in h e ()". + Extract Constant catch => "fun s h -> (); + fun () -> try s () + with Proof_errors.Exception e as src -> + let src = Errors.push src in + let e = Backtrace.app_backtrace ~src ~dst:e in + h e ()". Extraction Implicit catch [A]. Parameter read_line : T String. @@ -652,7 +657,11 @@ Module NonLogical. (* /!\ The extracted code for [run] performs effects. /!\ *) Parameter run : forall a:Set, t a -> a. - Extract Constant run => "fun x -> try x () with Proof_errors.Exception e -> let e = Errors.push e in Pervasives.raise e". + Extract Constant run => "fun x -> + try x () with Proof_errors.Exception e as src -> + let src = Errors.push src in + let e = Backtrace.app_backtrace ~src ~dst:e in + Pervasives.raise e". Extraction Implicit run [a]. End NonLogical. |
