diff options
Diffstat (limited to 'library')
-rw-r--r-- | library/library.ml | 6 | ||||
-rw-r--r-- | library/states.ml | 5 |
2 files changed, 7 insertions, 4 deletions
diff --git a/library/library.ml b/library/library.ml index a5f93c02c..edb86bc4c 100644 --- a/library/library.ml +++ b/library/library.ml @@ -318,7 +318,7 @@ let in_import : DirPath.t * bool -> obj = (*s Loading from disk to cache (preparation phase) *) let (raw_extern_library, raw_intern_library) = - System.raw_extern_intern Coq_config.vo_magic_number ".vo" + System.raw_extern_intern Coq_config.vo_magic_number (************************************************************************) (*s Locate absolute or partially qualified library names in the path *) @@ -401,10 +401,10 @@ let mk_library md table digest = let fetch_opaque_table (f,pos,digest) = try let ch = System.with_magic_number_check raw_intern_library f in - seek_in ch pos; + let () = seek_in ch pos in if not (String.equal (System.marshal_in f ch) digest) then failwith "File changed!"; let table = (System.marshal_in f ch : LightenLibrary.table) in - close_in ch; + let () = close_in ch in table with e when Errors.noncritical e -> error diff --git a/library/states.ml b/library/states.ml index f30633171..906ebdacc 100644 --- a/library/states.ml +++ b/library/states.ml @@ -18,13 +18,16 @@ let unfreeze (fl,fs) = Summary.unfreeze_summaries fs let (extern_state,intern_state) = + let ensure_suffix f = CUnix.make_suffix f ".coq" in let (raw_extern, raw_intern) = - extern_intern Coq_config.state_magic_number ".coq" in + extern_intern Coq_config.state_magic_number in (fun s -> + let s = ensure_suffix s in if !Flags.load_proofs <> Flags.Force then Errors.error "Write State only works with option -force-load-proofs"; raw_extern s (freeze())), (fun s -> + let s = ensure_suffix s in unfreeze (with_magic_number_check (raw_intern (Library.get_load_paths ())) s); Library.overwrite_library_filenames s) |