Permalink
Browse files

merge branch "safe-string"

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14705 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
  • Loading branch information...
1 parent 3ce32fb commit 5b8df637d2b722aa397ab53200a733bae238e9fe Damien Doligez committed Apr 29, 2014
Showing with 3,311 additions and 2,448 deletions.
  1. +10 −16 .depend
  2. +3 −0 Changes
  3. +2 −1 Makefile
  4. +1 −1 VERSION
  5. +3 −2 asmcomp/asmpackager.ml
  6. +1 −1 asmcomp/asmpackager.mli
  7. +2 −2 asmcomp/compilenv.ml
  8. +633 −633 asmrun/.depend
  9. BIN boot/ocamlc
  10. BIN boot/ocamldep
  11. BIN boot/ocamllex
  12. +1 −1 bytecomp/bytelibrarian.ml
  13. +9 −9 bytecomp/bytelink.ml
  14. +10 −7 bytecomp/bytepackager.ml
  15. +1 −1 bytecomp/bytepackager.mli
  16. +5 −3 bytecomp/bytesections.ml
  17. +1 −1 bytecomp/emitcode.ml
  18. +1 −1 bytecomp/emitcode.mli
  19. +1 −1 bytecomp/matching.ml
  20. +5 −5 bytecomp/meta.ml
  21. +5 −5 bytecomp/meta.mli
  22. +1 −1 bytecomp/symtable.ml
  23. +1 −1 bytecomp/symtable.mli
  24. +284 −281 byterun/.depend
  25. +4 −2 debugger/.depend
  26. +1 −1 debugger/Makefile.shared
  27. +3 −3 debugger/debugcom.ml
  28. +1 −1 debugger/input_handling.mli
  29. +1 −1 debugger/program_management.ml
  30. +1 −1 debugger/source.ml
  31. +1 −0 driver/compenv.ml
  32. +6 −4 driver/compmisc.ml
  33. +4 −1 driver/main.ml
  34. +28 −4 driver/main_args.ml
  35. +8 −0 driver/main_args.mli
  36. +4 −1 driver/optmain.ml
  37. +3 −3 driver/pparse.ml
  38. +1 −1 lex/Makefile
  39. +1 −1 lex/common.ml
  40. +13 −0 man/ocaml.m
  41. +13 −0 man/ocamlc.m
  42. +13 −0 man/ocamlopt.m
  43. +1 −1 ocamlbuild/Makefile
  44. +1 −1 ocamlbuild/Makefile.noboot
  45. +9 −9 ocamlbuild/display.ml
  46. +9 −18 ocamlbuild/my_std.ml
  47. +2 −2 ocamlbuild/my_unix.ml
  48. +4 −4 ocamlbuild/ocamlbuild_executor.ml
  49. +1 −1 ocamldoc/Makefile
  50. +6 −3 ocamldoc/odoc_analyse.ml
  51. +2 −2 ocamldoc/odoc_misc.ml
  52. +5 −10 ocamldoc/odoc_texi.ml
  53. +1 −1 otherlibs/Makefile.shared
  54. +15 −15 otherlibs/bigarray/.depend
  55. +2 −1 otherlibs/dynlink/Makefile
  56. +13 −11 otherlibs/dynlink/dynlink.ml
  57. +4 −4 otherlibs/dynlink/natdynlink.ml
  58. +100 −60 otherlibs/graph/.depend
  59. +10 −10 otherlibs/num/.depend
  60. +12 −10 otherlibs/num/big_int.ml
  61. +1 −1 otherlibs/num/big_int.mli
  62. +10 −13 otherlibs/num/nat.ml
  63. +25 −26 otherlibs/num/ratio.ml
  64. +5 −5 otherlibs/str/.depend
  65. +31 −23 otherlibs/str/str.ml
  66. +10 −10 otherlibs/systhreads/.depend
  67. +1 −1 otherlibs/systhreads/Makefile
  68. +6 −0 otherlibs/systhreads/threadUnix.ml
  69. +17 −8 otherlibs/systhreads/threadUnix.mli
  70. +10 −10 otherlibs/threads/.depend
  71. +1 −1 otherlibs/threads/Makefile
  72. +16 −14 otherlibs/threads/marshal.ml
  73. +47 −32 otherlibs/threads/pervasives.ml
  74. +7 −0 otherlibs/threads/threadUnix.ml
  75. +18 −7 otherlibs/threads/threadUnix.mli
  76. +27 −15 otherlibs/threads/unix.ml
  77. +404 −400 otherlibs/unix/.depend
  78. +28 −15 otherlibs/unix/unix.ml
  79. +33 −17 otherlibs/unix/unix.mli
  80. +37 −17 otherlibs/unix/unixLabels.mli
  81. +3 −2 parsing/ast_mapper.ml
  82. +10 −9 parsing/lexer.mll
  83. +4 −4 parsing/location.ml
  84. +56 −41 stdlib/.depend
  85. +5 −3 stdlib/Makefile.shared
  86. +2 −0 stdlib/StdlibModules
  87. +26 −24 stdlib/buffer.ml
  88. +22 −11 stdlib/buffer.mli
  89. +211 −0 stdlib/bytes.ml
  90. +226 −0 stdlib/bytes.mli
  91. +16 −0 stdlib/bytesLabels.ml
  92. +202 −0 stdlib/bytesLabels.mli
  93. +9 −12 stdlib/digest.ml
  94. +3 −5 stdlib/format.ml
  95. +8 −8 stdlib/genlex.ml
  96. +20 −27 stdlib/lexing.ml
  97. +5 −5 stdlib/lexing.mli
  98. +15 −11 stdlib/marshal.ml
  99. +29 −20 stdlib/marshal.mli
  100. +2 −2 stdlib/obj.ml
  101. +4 −4 stdlib/obj.mli
  102. +40 −29 stdlib/pervasives.ml
  103. +28 −12 stdlib/pervasives.mli
  104. +6 −6 stdlib/printf.ml
  105. +7 −13 stdlib/scanf.ml
  106. +2 −0 stdlib/stdLabels.ml
  107. +3 −1 stdlib/stdLabels.mli
  108. +5 −5 stdlib/stream.ml
  109. +49 −170 stdlib/string.ml
  110. +62 −60 stdlib/string.mli
  111. +75 −58 stdlib/stringLabels.mli
  112. +1 −1 stdlib/sys.mli
  113. +7 −7 testsuite/tests/asmcomp/lexcmm.mll
  114. +3 −3 testsuite/tests/basic-io-2/io.ml
  115. +1 −1 testsuite/tests/embedded/cmcaml.ml
  116. +22 −22 testsuite/tests/lib-marshal/intext.ml
  117. +1 −1 testsuite/tests/regression/pr5757/pr5757.ml
  118. +6 −8 tools/.depend
  119. +2 −2 tools/Makefile.shared
  120. +2 −2 tools/dumpobj.ml
  121. +3 −3 tools/objinfo.ml
  122. +2 −0 tools/ocamlcp.ml
  123. +9 −12 tools/ocamldep.ml
  124. +7 −3 tools/ocamlmklib.ml
  125. +2 −0 tools/ocamloptp.ml
  126. +1 −1 tools/ocamlprof.ml
  127. +2 −2 toplevel/topdirs.ml
  128. +1 −1 toplevel/toploop.ml
  129. +1 −1 toplevel/toploop.mli
  130. +2 −0 toplevel/topmain.ml
  131. +3 −1 typing/cmi_format.ml
  132. +1 −3 typing/cmt_format.ml
  133. +1 −1 typing/ctype.ml
  134. +1 −2 typing/env.ml
  135. +2 −1 typing/env.mli
  136. +4 −4 typing/includemod.ml
  137. +2 −1 typing/includemod.mli
  138. +11 −1 typing/predef.ml
  139. +3 −1 typing/predef.mli
  140. +5 −5 typing/typecore.ml
  141. +8 −7 typing/typemod.ml
  142. +3 −2 typing/typemod.mli
  143. +1 −1 typing/typetexp.ml
  144. +1 −0 utils/clflags.ml
  145. +1 −0 utils/clflags.mli
  146. +15 −24 utils/misc.ml
  147. +2 −7 utils/misc.mli
View
@@ -43,12 +43,8 @@ parsing/ast_helper.cmo : parsing/parsetree.cmi parsing/longident.cmi \
parsing/location.cmi parsing/asttypes.cmi parsing/ast_helper.cmi
parsing/ast_helper.cmx : parsing/parsetree.cmi parsing/longident.cmx \
parsing/location.cmx parsing/asttypes.cmi parsing/ast_helper.cmi
-parsing/ast_mapper.cmo : parsing/parsetree.cmi utils/misc.cmi \
- parsing/location.cmi utils/config.cmi parsing/ast_helper.cmi \
- parsing/ast_mapper.cmi
-parsing/ast_mapper.cmx : parsing/parsetree.cmi utils/misc.cmx \
- parsing/location.cmx utils/config.cmx parsing/ast_helper.cmx \
- parsing/ast_mapper.cmi
+parsing/ast_mapper.cmo : parsing/ast_mapper.cmi
+parsing/ast_mapper.cmx : parsing/ast_mapper.cmi
parsing/lexer.cmo : utils/warnings.cmi parsing/parser.cmi utils/misc.cmi \
parsing/location.cmi parsing/lexer.cmi
parsing/lexer.cmx : utils/warnings.cmx parsing/parser.cmx utils/misc.cmx \
@@ -148,9 +144,9 @@ typing/btype.cmo : typing/types.cmi typing/path.cmi utils/misc.cmi \
typing/ident.cmi typing/btype.cmi
typing/btype.cmx : typing/types.cmx typing/path.cmx utils/misc.cmx \
typing/ident.cmx typing/btype.cmi
-typing/cmi_format.cmo : typing/types.cmi utils/misc.cmi parsing/location.cmi \
+typing/cmi_format.cmo : typing/types.cmi parsing/location.cmi \
utils/config.cmi typing/cmi_format.cmi
-typing/cmi_format.cmx : typing/types.cmx utils/misc.cmx parsing/location.cmx \
+typing/cmi_format.cmx : typing/types.cmx parsing/location.cmx \
utils/config.cmx typing/cmi_format.cmi
typing/cmt_format.cmo : typing/types.cmi typing/typedtreeMap.cmi \
typing/typedtree.cmi utils/misc.cmi parsing/location.cmi \
@@ -160,12 +156,12 @@ typing/cmt_format.cmx : typing/types.cmx typing/typedtreeMap.cmx \
typing/typedtree.cmx utils/misc.cmx parsing/location.cmx \
parsing/lexer.cmx typing/env.cmx utils/config.cmx typing/cmi_format.cmx \
utils/clflags.cmx typing/cmt_format.cmi
-typing/ctype.cmo : typing/types.cmi typing/subst.cmi typing/path.cmi \
- utils/misc.cmi parsing/longident.cmi parsing/location.cmi \
+typing/ctype.cmo : typing/types.cmi typing/subst.cmi typing/predef.cmi \
+ typing/path.cmi utils/misc.cmi parsing/longident.cmi parsing/location.cmi \
typing/ident.cmi typing/env.cmi utils/clflags.cmi typing/btype.cmi \
parsing/asttypes.cmi typing/ctype.cmi
-typing/ctype.cmx : typing/types.cmx typing/subst.cmx typing/path.cmx \
- utils/misc.cmx parsing/longident.cmx parsing/location.cmx \
+typing/ctype.cmx : typing/types.cmx typing/subst.cmx typing/predef.cmx \
+ typing/path.cmx utils/misc.cmx parsing/longident.cmx parsing/location.cmx \
typing/ident.cmx typing/env.cmx utils/clflags.cmx typing/btype.cmx \
parsing/asttypes.cmi typing/ctype.cmi
typing/datarepr.cmo : typing/types.cmi typing/predef.cmi typing/path.cmi \
@@ -448,10 +444,8 @@ bytecomp/bytepackager.cmx : typing/typemod.cmx bytecomp/translmod.cmx \
typing/env.cmx bytecomp/emitcode.cmx utils/config.cmx \
bytecomp/cmo_format.cmi utils/clflags.cmx bytecomp/bytelink.cmx \
bytecomp/bytegen.cmx bytecomp/bytepackager.cmi
-bytecomp/bytesections.cmo : utils/misc.cmi utils/config.cmi \
- bytecomp/bytesections.cmi
-bytecomp/bytesections.cmx : utils/misc.cmx utils/config.cmx \
- bytecomp/bytesections.cmi
+bytecomp/bytesections.cmo : utils/config.cmi bytecomp/bytesections.cmi
+bytecomp/bytesections.cmx : utils/config.cmx bytecomp/bytesections.cmi
bytecomp/dll.cmo : utils/misc.cmi utils/config.cmi bytecomp/dll.cmi
bytecomp/dll.cmx : utils/misc.cmx utils/config.cmx bytecomp/dll.cmi
bytecomp/emitcode.cmo : bytecomp/translmod.cmi typing/primitive.cmi \
View
@@ -8,6 +8,8 @@ Language features:
- Generative functors
- Module aliases
* Alternative syntax for string literals {id|...|id} (can break comments)
+- Separation between read-only strings (type string) and read-write byte
+ sequences (type bytes). Activated by command-line option -safe-string.
Build system for the OCaml distribution:
- Use -bin-annot when building.
@@ -74,6 +76,7 @@ Runtime system:
64-bit integer type.
Standard library:
+* Added a new module: Bytes.
- PR#4986: add List.sort_uniq and Set.of_list
- PR#5935: a faster version of "raise" which does not maintain the backtrace
- PR#6146: support "Unix.kill pid Sys.sigkill" under Windows
View
@@ -17,7 +17,8 @@ include stdlib/StdlibModules
CAMLC=boot/ocamlrun boot/ocamlc -nostdlib -I boot
CAMLOPT=boot/ocamlrun ./ocamlopt -nostdlib -I stdlib -I otherlibs/dynlink
-COMPFLAGS=-strict-sequence -w +33..39+48 -warn-error A -bin-annot $(INCLUDES)
+COMPFLAGS=-strict-sequence -w +33..39+48 -warn-error A -bin-annot \
+ -safe-string $(INCLUDES)
LINKFLAGS=
CAMLYACC=boot/ocamlyacc
View
@@ -1,4 +1,4 @@
-4.02.0+dev4-2014-04-03
+4.02.0+dev5-2014-04-29
# The version string is the first line of this file.
# It must be in the format described in stdlib/sys.mli
@@ -161,7 +161,7 @@ let package_object_files ppf files targetcmx
(* The entry point *)
-let package_files ppf files targetcmx =
+let package_files ppf initial_env files targetcmx =
let files =
List.map
(fun f ->
@@ -177,7 +177,8 @@ let package_files ppf files targetcmx =
(* Set the name of the current compunit *)
Compilenv.reset ?packname:!Clflags.for_package targetname;
try
- let coercion = Typemod.package_units files targetcmi targetname in
+ let coercion =
+ Typemod.package_units initial_env files targetcmi targetname in
package_object_files ppf files targetcmx targetobj targetname coercion
with x ->
remove_file targetcmx; remove_file targetobj;
@@ -13,7 +13,7 @@
(* "Package" a set of .cmx/.o files into one .cmx/.o file having the
original compilation units as sub-modules. *)
-val package_files: Format.formatter -> string list -> string -> unit
+val package_files: Format.formatter -> Env.t -> string list -> string -> unit
type error =
Illegal_renaming of string * string * string
@@ -118,7 +118,7 @@ let symbol_in_current_unit name =
let read_unit_info filename =
let ic = open_in_bin filename in
try
- let buffer = input_bytes ic (String.length cmx_magic_number) in
+ let buffer = really_input_string ic (String.length cmx_magic_number) in
if buffer <> cmx_magic_number then begin
close_in ic;
raise(Error(Not_a_unit_info filename))
@@ -133,7 +133,7 @@ let read_unit_info filename =
let read_library_info filename =
let ic = open_in_bin filename in
- let buffer = input_bytes ic (String.length cmxa_magic_number) in
+ let buffer = really_input_string ic (String.length cmxa_magic_number) in
if buffer <> cmxa_magic_number then
raise(Error(Not_a_unit_info filename));
let infos = (input_value ic : library_infos) in
Oops, something went wrong.

0 comments on commit 5b8df63

Please sign in to comment.