From bff51607cfdda137d7bc55d802895d7f794d5768 Mon Sep 17 00:00:00 2001 From: Pierre-Marie Pédrot Date: Wed, 3 Dec 2014 20:34:09 +0100 Subject: Getting rid of Exninfo hacks. Instead of modifying exceptions to wear additional information, we instead use a dedicated type now. All exception-using functions were modified to support this new type, in particular Future's fix_exn-s and the tactic monad. To solve the problem of enriching exceptions at raise time and recover this data in the try-with handler, we use a global datastructure recording the given piece of data imperatively that we retrieve in the try-with handler. We ensure that such instrumented try-with destroy the data so that there may not be confusion with another exception. To further harden the correction of this structure, we also check for pointer equality with the last raised exception. The global data structure is not thread-safe for now, which is incorrect as the STM uses threads and enriched exceptions. Yet, we splitted the patch in two parts, so that we do not introduce dependencies to the Thread library immediatly. This will allow to revert only the second patch if ever we switch to OCaml-coded lightweight threads. --- parsing/compat.ml4 | 2 +- parsing/egramcoq.ml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'parsing') diff --git a/parsing/compat.ml4 b/parsing/compat.ml4 index f872c4a2d8..ce0390e1d2 100644 --- a/parsing/compat.ml4 +++ b/parsing/compat.ml4 @@ -193,7 +193,7 @@ module GrammarMake (L:LexerSig) : GrammarSig = struct let entry_create = Entry.create let entry_parse e p = try Entry.parse e p - with Exc_located (loc,e) -> raise (Loc.add_loc e (to_coqloc loc)) + with Exc_located (loc,e) -> Loc.raise (to_coqloc loc) e IFDEF CAMLP5_6_02_1 THEN let entry_print ft x = Entry.print ft x ELSE diff --git a/parsing/egramcoq.ml b/parsing/egramcoq.ml index a0384faf84..9f49638618 100644 --- a/parsing/egramcoq.ml +++ b/parsing/egramcoq.ml @@ -355,7 +355,7 @@ let with_grammar_rule_protection f x = with reraise -> let reraise = Errors.push reraise in let () = unfreeze fs in - raise reraise + iraise reraise (**********************************************************************) (** Ltac quotations *) -- cgit v1.2.3