| Attached Files | RenamingError.patch [^] (8,914 bytes) 2012-11-17 21:35 [Show Content] [Hide Content]--- ocaml-4.00.1-release/asmcomp/asmpackager.ml 2012-03-07 12:50:17.000000000 -0500
+++ ocaml-4.00.1/asmcomp/asmpackager.ml 2012-11-14 18:11:16.141400000 -0500
@@ -22,7 +22,7 @@
open Cmx_format
type error =
- Illegal_renaming of string * string
+ Illegal_renaming of string * string * string
| Forward_reference of string * string
| Wrong_for_pack of string * string
| Linking_error
@@ -41,14 +41,14 @@
pm_name: string;
pm_kind: pack_member_kind }
-let read_member_info pack_path file =
+let read_member_info pack_path file = (
let name =
String.capitalize(Filename.basename(chop_extensions file)) in
let kind =
if Filename.check_suffix file ".cmx" then begin
let (info, crc) = Compilenv.read_unit_info file in
if info.ui_name <> name
- then raise(Error(Illegal_renaming(file, info.ui_name)));
+ then raise(Error(Illegal_renaming(name, file, info.ui_name)));
if info.ui_symbol <>
(Compilenv.current_unit_infos()).ui_symbol ^ "__" ^ info.ui_name
then raise(Error(Wrong_for_pack(file, pack_path)));
@@ -58,6 +58,7 @@
end else
PM_intf in
{ pm_file = file; pm_name = name; pm_kind = kind }
+)
(* Check absence of forward references *)
@@ -192,9 +193,9 @@
open Format
let report_error ppf = function
- Illegal_renaming(file, id) ->
- fprintf ppf "Wrong file naming: %a@ contains the code for@ %s"
- Location.print_filename file id
+ Illegal_renaming(name, file, id) ->
+ fprintf ppf "Wrong file naming: %a@ contains the code for @ %s when %s was expected"
+ Location.print_filename file name id
| Forward_reference(file, ident) ->
fprintf ppf "Forward reference to %s in file %a" ident
Location.print_filename file
--- ocaml-4.00.1-release/asmcomp/asmpackager.mli 2012-01-20 09:23:34.000000000 -0500
+++ ocaml-4.00.1/asmcomp/asmpackager.mli 2012-11-14 18:11:16.150400000 -0500
@@ -18,7 +18,7 @@
val package_files: Format.formatter -> string list -> string -> unit
type error =
- Illegal_renaming of string * string
+ Illegal_renaming of string * string * string
| Forward_reference of string * string
| Wrong_for_pack of string * string
| Linking_error
--- ocaml-4.00.1-release/asmcomp/compilenv.ml 2012-03-07 12:50:17.000000000 -0500
+++ ocaml-4.00.1/asmcomp/compilenv.ml 2012-11-14 18:11:16.161400000 -0500
@@ -22,7 +22,7 @@
type error =
Not_a_unit_info of string
| Corrupted_unit_info of string
- | Illegal_renaming of string * string
+ | Illegal_renaming of string * string * string
exception Error of error
@@ -115,7 +115,7 @@
let cmx_not_found_crc =
"\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"
-let get_global_info global_ident =
+let get_global_info global_ident = (
let modname = Ident.name global_ident in
if modname = current_unit.ui_name then
Some current_unit
@@ -129,7 +129,7 @@
find_in_path_uncap !load_path (modname ^ ".cmx") in
let (ui, crc) = read_unit_info filename in
if ui.ui_name <> modname then
- raise(Error(Illegal_renaming(ui.ui_name, filename)));
+ raise(Error(Illegal_renaming(modname, ui.ui_name, filename)));
(Some ui, crc)
with Not_found ->
(None, cmx_not_found_crc) in
@@ -138,6 +138,7 @@
Hashtbl.add global_infos_table modname infos;
infos
end
+)
let cache_unit_info ui =
Hashtbl.add global_infos_table ui.ui_name (Some ui)
@@ -232,6 +233,6 @@
| Corrupted_unit_info filename ->
fprintf ppf "Corrupted compilation unit description@ %a"
Location.print_filename filename
- | Illegal_renaming(modname, filename) ->
- fprintf ppf "%a@ contains the description for unit@ %s"
- Location.print_filename filename modname
+ | Illegal_renaming(name, modname, filename) ->
+ fprintf ppf "%a@ contains the description for unit @ %s when %s was expected"
+ Location.print_filename filename name modname
--- ocaml-4.00.1-release/bytecomp/bytepackager.ml 2012-07-30 14:59:07.000000000 -0400
+++ ocaml-4.00.1/bytecomp/bytepackager.ml 2012-11-14 18:11:16.170400000 -0500
@@ -23,7 +23,7 @@
Forward_reference of string * Ident.t
| Multiple_definition of string * Ident.t
| Not_an_object_file of string
- | Illegal_renaming of string * string
+ | Illegal_renaming of string * string * string
| File_not_found of string
exception Error of error
@@ -93,7 +93,7 @@
pm_name: string;
pm_kind: pack_member_kind }
-let read_member_info file =
+let read_member_info file = (
let name =
String.capitalize(Filename.basename(chop_extensions file)) in
let kind =
@@ -107,7 +107,7 @@
seek_in ic compunit_pos;
let compunit = (input_value ic : compilation_unit) in
if compunit.cu_name <> name
- then raise(Error(Illegal_renaming(file, compunit.cu_name)));
+ then raise(Error(Illegal_renaming(name, file, compunit.cu_name)));
close_in ic;
PM_impl compunit
with x ->
@@ -116,6 +116,7 @@
end else
PM_intf in
{ pm_file = file; pm_name = name; pm_kind = kind }
+)
(* Read the bytecode from a .cmo file.
Write bytecode to channel [oc].
@@ -264,8 +265,8 @@
| Not_an_object_file file ->
fprintf ppf "%a is not a bytecode object file"
Location.print_filename file
- | Illegal_renaming(file, id) ->
- fprintf ppf "Wrong file naming: %a@ contains the code for@ %s"
- Location.print_filename file id
+ | Illegal_renaming(name, file, id) ->
+ fprintf ppf "Wrong file naming: %a@ contains the code for @ %s when %s was expected"
+ Location.print_filename file name id
| File_not_found file ->
fprintf ppf "File %s not found" file
--- ocaml-4.00.1-release/typing/env.ml 2012-08-03 16:23:26.000000000 -0400
+++ ocaml-4.00.1/typing/env.ml 2012-11-14 18:11:16.181400000 -0500
@@ -54,7 +54,7 @@
= Hashtbl.create 16
type error =
- | Illegal_renaming of string * string
+ | Illegal_renaming of string * string * string
| Inconsistent_import of string * string * string
| Need_recursive_types of string * string
@@ -275,7 +275,7 @@
(* Reading persistent structures from .cmi files *)
-let read_pers_struct modname filename =
+let read_pers_struct modname filename = (
let cmi = read_cmi filename in
let name = cmi.cmi_name in
let sign = cmi.cmi_sign in
@@ -290,9 +290,9 @@
ps_comps = comps;
ps_crcs = crcs;
ps_filename = filename;
- ps_flags = flags } in
+ ps_flags = flags } in
if ps.ps_name <> modname then
- raise(Error(Illegal_renaming(ps.ps_name, filename)));
+ raise(Error(Illegal_renaming(modname, ps.ps_name, filename)));
check_consistency filename ps.ps_crcs;
List.iter
(function Rectypes ->
@@ -301,6 +301,7 @@
ps.ps_flags;
Hashtbl.add persistent_structures modname (Some ps);
ps
+)
let find_pers_struct name =
if name = "*predef*" then raise Not_found;
@@ -1322,9 +1323,9 @@
open Format
let report_error ppf = function
- | Illegal_renaming(modname, filename) -> fprintf ppf
- "Wrong file naming: %a@ contains the compiled interface for@ %s"
- Location.print_filename filename modname
+ | Illegal_renaming(name, modname, filename) -> fprintf ppf
+ "Wrong file naming: %a@ contains the compiled interface for @ %s when %s was expected"
+ Location.print_filename filename name modname
| Inconsistent_import(name, source1, source2) -> fprintf ppf
"@[<hov>The files %a@ and %a@ \
make inconsistent assumptions@ over interface %s@]"
--- ocaml-4.00.1-release/asmcomp/compilenv.mli 2012-03-08 14:52:03.000000000 -0500
+++ ocaml-4.00.1/asmcomp/compilenv.mli 2012-11-14 18:11:16.190400000 -0500
@@ -76,7 +76,7 @@
type error =
Not_a_unit_info of string
| Corrupted_unit_info of string
- | Illegal_renaming of string * string
+ | Illegal_renaming of string * string * string
exception Error of error
--- ocaml-4.00.1-release/bytecomp/bytepackager.mli 2012-01-20 09:23:34.000000000 -0500
+++ ocaml-4.00.1/bytecomp/bytepackager.mli 2012-11-14 18:11:16.200400000 -0500
@@ -21,7 +21,7 @@
Forward_reference of string * Ident.t
| Multiple_definition of string * Ident.t
| Not_an_object_file of string
- | Illegal_renaming of string * string
+ | Illegal_renaming of string * string * string
| File_not_found of string
exception Error of error
--- ocaml-4.00.1-release/typing/env.mli 2012-07-30 14:59:07.000000000 -0400
+++ ocaml-4.00.1/typing/env.mli 2012-11-14 18:11:16.209400000 -0500
@@ -152,7 +152,7 @@
(* Error report *)
type error =
- | Illegal_renaming of string * string
+ | Illegal_renaming of string * string * string
| Inconsistent_import of string * string * string
| Need_recursive_types of string * string
|