aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Enrico Tassi <Enrico.Tassi@inria.fr>2014-08-24 11:17:00 +0200
committerGravatar Enrico Tassi <Enrico.Tassi@inria.fr>2014-09-02 11:29:41 +0200
commit7befcc7ea63ea4bd6e45e6f4b8ec01a69b586cc7 (patch)
tree470fc001243f986487e0cc1060db4aebd9e0987d
parent3c5daf4e23ee20f0788c0deab688af452e83ccf0 (diff)
Fix Declaremods.end_library (Closes: #3536)
-rw-r--r--library/declaremods.ml3
-rw-r--r--library/lib.ml5
-rw-r--r--library/lib.mli4
3 files changed, 9 insertions, 3 deletions
diff --git a/library/declaremods.ml b/library/declaremods.ml
index e4f227637..bf6fe9f0d 100644
--- a/library/declaremods.ml
+++ b/library/declaremods.ml
@@ -874,8 +874,9 @@ let start_library dir =
Lib.add_frozen_state ()
let end_library dir =
+ let oname = Lib.end_compilation_checks dir in
let mp,cenv,ast = Global.export dir in
- let prefix, lib_stack = Lib.end_compilation dir in
+ let prefix, lib_stack = Lib.end_compilation oname in
assert (ModPath.equal mp (MPfile dir));
let substitute, keep, _ = Lib.classify_segment lib_stack in
cenv,(substitute,keep),ast
diff --git a/library/lib.ml b/library/lib.ml
index 1ee3ca57b..f33f244b8 100644
--- a/library/lib.ml
+++ b/library/lib.ml
@@ -313,7 +313,7 @@ let start_compilation s mp =
comp_name := Some s;
path_prefix := prefix
-let end_compilation dir =
+let end_compilation_checks dir =
let _ =
try match snd (find_entry_p is_opening_node) with
| OpenedSection _ -> error "There are some open sections."
@@ -338,6 +338,9 @@ let end_compilation dir =
(str "The current open module has name" ++ spc () ++ pr_dirpath m ++
spc () ++ str "and not" ++ spc () ++ pr_dirpath m);
in
+ oname
+
+let end_compilation oname =
let (after,mark,before) = split_lib_at_opening oname in
comp_name := None;
!path_prefix,after
diff --git a/library/lib.mli b/library/lib.mli
index 615a39f9e..b5a32f762 100644
--- a/library/lib.mli
+++ b/library/lib.mli
@@ -127,7 +127,9 @@ val end_modtype :
(** {6 Compilation units } *)
val start_compilation : Names.DirPath.t -> Names.module_path -> unit
-val end_compilation : Names.DirPath.t -> Libnames.object_prefix * library_segment
+val end_compilation_checks : Names.DirPath.t -> Libnames.object_name
+val end_compilation :
+ Libnames.object_name-> Libnames.object_prefix * library_segment
(** The function [library_dp] returns the [DirPath.t] of the current
compiling library (or [default_library]) *)