From b9389f46240297ef827cd2bd5585103679a1d100 Mon Sep 17 00:00:00 2001 From: Stephane Glondu Date: Wed, 3 Jun 2009 13:13:03 +0200 Subject: [PATCH] Imported Upstream version 3.11.1~rc1 --- Changes | 8 ++++++-- VERSION | 4 ++-- boot/.cvsignore | 1 + boot/ocamlc | Bin 1043760 -> 1043810 bytes boot/ocamldep | Bin 289197 -> 289207 bytes boot/ocamllex | Bin 165447 -> 165450 bytes build/fastworld.sh | 4 ++-- build/otherlibs-targets.sh | 5 +++-- build/world.sh | 4 ++-- byterun/Makefile | 20 +++++++++++-------- byterun/Makefile.common | 4 ++-- byterun/interp.c | 4 ++-- configure | 8 +++++++- debugger/parser.mly | 3 ++- man/ocamldoc.m | 7 ++----- myocamlbuild.ml | 5 +++-- ocamlbuild/ocamlbuild_where.ml | 6 ++++-- ocamldoc/Makefile.nt | 14 ++++++------- otherlibs/labltk/examples_camltk/Makefile.nt | 2 +- otherlibs/labltk/examples_labltk/Makefile.nt | 2 +- otherlibs/num/big_int.ml | 6 ++++-- otherlibs/num/test/test_big_ints.ml | 8 +++++--- otherlibs/win32unix/createprocess.c | 9 ++++----- yacc/reader.c | 9 +++++---- 24 files changed, 77 insertions(+), 56 deletions(-) diff --git a/Changes b/Changes index 34eb1d98..d345f33f 100644 --- a/Changes +++ b/Changes @@ -28,11 +28,15 @@ Bug fixes: - PR#4766: incorrect simplification of some type abbreviations. - PR#4768: printf: %F does not respect width and precision specifications - PR#4769: Format.bprintf fails to flush -- PR#4775: compiler crash on crazy types (temporary fix) +- PR#4775: fatal error Ctype.Unify during module type-checking (temporary fix) - PR#4776: bad interaction between exceptions and classes - PR#4780: labltk build problem under Windows. - PR#4790: under Windows, map ERROR_NO_DATA Win32 error to EPIPE Unix error. - PR#4792: bug in Big_int.big_int_of_int64 on 32-bit platforms. +- PR#4796: ocamlyacc: missing NUL termination of string +- PR#4804: bug in Big_int.int64_of_big_int on 32-bit platforms. +- PR#4805: improving compatibility with the clang C compiler +- PR#4809: issue with Unix.create_process under Win32 - Module Parsing: improved computation of locations when an ocamlyacc rule starts with an empty nonterminal - Type-checker: fixed wrong variance computation for private types @@ -2435,4 +2439,4 @@ Caml Special Light 1.06: * First public release. -$Id: Changes,v 1.183.2.13 2009/05/19 14:46:13 doligez Exp $ +$Id: Changes,v 1.183.2.17 2009/06/02 21:41:53 doligez Exp $ diff --git a/VERSION b/VERSION index 7486269b..f71d01de 100644 --- a/VERSION +++ b/VERSION @@ -1,6 +1,6 @@ -3.11.1+rc0 +3.11.1+rc1 # The version string is the first line of this file. # It must be in the format described in stdlib/sys.mli -# $Id: VERSION,v 1.26.2.13 2009/05/19 14:46:13 doligez Exp $ +# $Id: VERSION,v 1.26.2.17 2009/06/02 21:41:53 doligez Exp $ diff --git a/boot/.cvsignore b/boot/.cvsignore index b9c6f858..a0a2356c 100644 --- a/boot/.cvsignore +++ b/boot/.cvsignore @@ -3,3 +3,4 @@ ocamlrun ocamlyacc camlheader myocamlbuild +myocamlbuild.native diff --git a/boot/ocamlc b/boot/ocamlc index 8c55166e1bbafa43c8047fd2da59b876319c5729..7bddd8363f894e4795a1e049901951db5b195b4b 100755 GIT binary patch delta 912 zcmZA0SxA&o6ae7=*nesq{nJUC2~)bG zv^-%U6hTHsWy{|}NCrjXgQKJA=uB#A5GGdSgGi?{SRp-p+yn%hUiDJoX>@GTd2Lo;RPVK1DemRdDUFUiNz<6xt_HY7--u{KPA6pCTGy|@-GQ=J!6;Rkhj@rP-$iTO-3^SE%l zVQwXl4-fhe_z^#wHoRqyf6shfM6@t(CPzPBg=q5i<4bT--GH3p7&!(p2F_E_pxpgN za(qJ8?sqV&ADHdJO4&nlAU8D*VL`xT4}}clKB%P=!u+OOiA=# znM+kgBPeEzIl>?Ug;4~FV7+KW`#DGZsVJf4igIJIq7)nS;xWxM3vBv{Z`x@iEuYdX z(MO!N$<6{=22NeMK?yq>-{J~XyC)leBU*Xndu36YC@hPjuL07 z6H1+?QfJsTr+Hin4qu{_qS%Kxo=)!>6s;GPm>U|&yAGqNtI}+y4Y_zSJ{*+#4~g>$ z1NFnko)UdH38qqk52G+j6c_ocEp~8KbT>rN1s_JjM9N+Vj*6NpGtCLpM$^_27*3IS zxB_ldVIH=@Av*I}vs2e8bBw+(ANz{HO}m~VK@!>g7zeXxt{01k}(` z!xA#28_@%gX=NkorkZNnywAD_*m$=+y3ek*LxDifKGEFX7UWhUam2HwlMx0=1EuG93nQebH zlgypZCGp?A;j^D&d(knax&2RQ!~oa6jz8g%1GG!Dx);aWvcx3nze>l-%6m~5Bxu55 zVTdqPun6ILd9U@GX8oX4!}v97aZXyMQuYXMN^XjRccvu;ne&y>cBkf~irq3= TT(s2Hg_{%IZuioJgjv4^&oeMEA7x;O@@HT$nzlVghFOrA(Qtd7 zJhLmOB&U*oX>pN$PJVJ?jy{mc&CxeDG&C$qo_<1uSyn<7hiv;V4d(5?G*~7%Fg~8% Io5`X80QIgWXaE2J delta 115 zcmdmfS#a%T!3pAxQms;qtx`-|rI;;bcuz1eFdt=Li1KA%Fq*nOUWQqanbBZ-p**uI zr>MPtX>pN$PJVJ?jy{mc&CxeDG@O23gIQKo37b?qizf4S7EP8(4vcrEPtRmg005HY BA-Mnm diff --git a/boot/ocamllex b/boot/ocamllex index 087d530dc18a7e2b601676001253a01dc07e3356..f2b80521dd88d808a777331edddb5d005e5f3c5d 100755 GIT binary patch delta 29 kcmX@!!*!~MYl1jaQF5bLs~F=}F{WfUM#Jq@ZcJzG0hv$ version.h -clean: +clean :: rm -f ocamlrun$(EXE) ocamlrund$(EXE) *.$(O) *.$(A) *.$(SO) rm -f primitives prims.c opnames.h jumptbl.h ld.conf rm -f version.h diff --git a/byterun/interp.c b/byterun/interp.c index c8626504..7e997871 100644 --- a/byterun/interp.c +++ b/byterun/interp.c @@ -11,7 +11,7 @@ /* */ /***********************************************************************/ -/* $Id: interp.c,v 1.97 2008/08/01 11:52:31 xleroy Exp $ */ +/* $Id: interp.c,v 1.97.2.1 2009/05/25 08:02:16 xleroy Exp $ */ /* The bytecode interpreter */ #include @@ -113,7 +113,7 @@ sp is a local copy of the global variable caml_extern_sp. */ For GCC, I have hand-assigned hardware registers for several architectures. */ -#if defined(__GNUC__) && !defined(__INTEL_COMPILER) && !defined(DEBUG) +#if defined(__GNUC__) && !defined(DEBUG) && !defined(__INTEL_COMPILER) && !defined(__llvm__) #ifdef __mips__ #define PC_REG asm("$16") #define SP_REG asm("$17") diff --git a/configure b/configure index e736a923..166ceafb 100755 --- a/configure +++ b/configure @@ -13,7 +13,7 @@ # # ######################################################################### -# $Id: configure,v 1.266.2.4 2009/05/19 13:23:47 doligez Exp $ +# $Id: configure,v 1.266.2.5 2009/05/20 15:33:09 weis Exp $ configure_options="$*" prefix=/usr/local @@ -1198,6 +1198,12 @@ x11_link="not found" for dir in \ $x11_include_dir \ \ + /usr/X11R7/include \ + /usr/include/X11R7 \ + /usr/local/X11R7/include \ + /usr/local/include/X11R7 \ + /opt/X11R7/include \ + \ /usr/X11R6/include \ /usr/include/X11R6 \ /usr/local/X11R6/include \ diff --git a/debugger/parser.mly b/debugger/parser.mly index 750f2963..40531b92 100644 --- a/debugger/parser.mly +++ b/debugger/parser.mly @@ -11,7 +11,7 @@ /* */ /***********************************************************************/ -/* $Id: parser.mly,v 1.7.28.3 2009/04/15 11:09:56 xclerc Exp $ */ +/* $Id: parser.mly,v 1.7.28.4 2009/05/23 14:42:57 xclerc Exp $ */ %{ @@ -182,6 +182,7 @@ longident_eol : opt_longident : UIDENT { Some (Lident $1) } + | LIDENT { Some (Lident $1) } | module_path DOT UIDENT { Some (Ldot($1, $3)) } | { None }; diff --git a/man/ocamldoc.m b/man/ocamldoc.m index 5d1ed6ad..df807c7d 100644 --- a/man/ocamldoc.m +++ b/man/ocamldoc.m @@ -1,4 +1,4 @@ -\" $Id: ocamldoc.m,v 1.5 2008/09/15 14:12:56 doligez Exp $ +\" $Id: ocamldoc.m,v 1.5.2.1 2009/05/27 14:35:27 doligez Exp $ .TH OCAMLDOC 1 @@ -110,10 +110,7 @@ to display it. .TP .BI \-g \ file Dynamically load the given file (which extension usually is .cmo or .cma), -which defines a custom documentation generator. This option is supported by the -.BR ocamldoc (1) -command, but not by its native-code version -.BR ocamldoc.opt . +which defines a custom documentation generator. If the given file is a simple one and does not exist in the current directory, then ocamldoc looks for it in the custom generators default directory, and in the directories specified with the diff --git a/myocamlbuild.ml b/myocamlbuild.ml index 6e9d40d6..c811a80e 100644 --- a/myocamlbuild.ml +++ b/myocamlbuild.ml @@ -10,7 +10,7 @@ (* *) (***********************************************************************) -(* $Id: myocamlbuild.ml,v 1.23.2.5 2009/05/05 13:40:18 ertai Exp $ *) +(* $Id: myocamlbuild.ml,v 1.23.2.6 2009/05/26 12:49:16 ertai Exp $ *) open Ocamlbuild_plugin open Command @@ -400,6 +400,7 @@ rule "native stdlib in mixed mode" copy_rule' ~insert:`top "otherlibs/dynlink/natdynlink.ml" "otherlibs/dynlink/nat/dynlink.ml";; copy_rule' ~insert:`top "otherlibs/dynlink/dynlink.mli" "otherlibs/dynlink/nat/dynlink.mli";; copy_rule' ~insert:`top "otherlibs/dynlink/nat/dynlink.cmx" "otherlibs/dynlink/dynlink.cmx";; +copy_rule' ~insert:`top ("otherlibs/dynlink/nat/dynlink"-.-C.o) ("otherlibs/dynlink/dynlink"-.-C.o);; copy_rule' ~insert:`top "otherlibs/dynlink/nat/dynlink.cmxa" "otherlibs/dynlink/dynlink.cmxa";; copy_rule' ~insert:`top ("otherlibs/dynlink/nat/dynlink"-.-C.a) ("otherlibs/dynlink/dynlink"-.-C.a);; dep ["ocaml"; "compile"; "native"; "file:otherlibs/dynlink/nat/dynlink.cmx"] ["otherlibs/dynlink/nat/dynlink.cmi"];; @@ -1090,7 +1091,7 @@ rule "labltk.cma" let labltk_cmxa_contents = labltk_contents "cmx" in rule "labltk.cmxa" - ~prod:"otherlibs/labltk/lib/labltk.cmxa" + ~prods:["otherlibs/labltk/lib/labltk.cmxa"; "otherlibs/labltk/lib/labltk"-.-C.a] ~deps:labltk_cmxa_contents (Ocamlbuild_pack.Ocaml_compiler.native_library_link_modules labltk_lib_contents "otherlibs/labltk/lib/labltk.cmxa");; diff --git a/ocamlbuild/ocamlbuild_where.ml b/ocamlbuild/ocamlbuild_where.ml index 1703a533..14fcde5d 100644 --- a/ocamlbuild/ocamlbuild_where.ml +++ b/ocamlbuild/ocamlbuild_where.ml @@ -1,5 +1,7 @@ let bindir = ref Ocamlbuild_Myocamlbuild_config.bindir;; let libdir = ref begin - try Filename.concat (Sys.getenv "OCAMLLIB") "ocamlbuild" - with Not_found -> Ocamlbuild_Myocamlbuild_config.libdir + Filename.concat + (try Sys.getenv "OCAMLLIB" + with Not_found -> Ocamlbuild_Myocamlbuild_config.libdir) + "ocamlbuild" end;; diff --git a/ocamldoc/Makefile.nt b/ocamldoc/Makefile.nt index 009bfbd1..ec7504dd 100644 --- a/ocamldoc/Makefile.nt +++ b/ocamldoc/Makefile.nt @@ -9,7 +9,7 @@ #(* *) #(***********************************************************************) -# $Id: Makefile.nt,v 1.27.4.1 2009/04/09 13:56:38 guesdon Exp $ +# $Id: Makefile.nt,v 1.27.4.2 2009/05/20 12:07:05 doligez Exp $ include ../config/Makefile @@ -24,7 +24,7 @@ OCAMLBIN = $(BINDIR) OCAMLPP=-pp "grep -v DEBUG" -# For installation +# For installation ############## MKDIR=mkdir CP=cp @@ -179,18 +179,18 @@ OCAMLCMXFILES=$(OCAMLCMOFILES:.cmo=.cmx) all: exe lib exe: $(OCAMLDOC) -lib: $(OCAMLDOC_LIBCMA) $(OCAMLDOC_LIBCMI) +lib: $(OCAMLDOC_LIBCMA) $(OCAMLDOC_LIBCMI) opt.opt: exeopt libopt exeopt: $(OCAMLDOC_OPT) -libopt: $(OCAMLDOC_LIBCMXA) $(OCAMLDOC_LIBCMI) -debug: +libopt: $(OCAMLDOC_LIBCMXA) $(OCAMLDOC_LIBCMI) +debug: make OCAMLPP="" -$(OCAMLDOC): $(EXECMOFILES) +$(OCAMLDOC): $(EXECMOFILES) $(OCAMLC) -o $@ -linkall unix.cma str.cma dynlink.cma $(LINKFLAGS) $(OCAMLCMOFILES) $(EXECMOFILES) $(OCAMLDOC_OPT): $(EXECMXFILES) - $(OCAMLOPT) -o $@ unix.cmxa str.cmxa $(LINKFLAGS) $(OCAMLCMXFILES) $(EXECMXFILES) + $(OCAMLOPT) -o $@ unix.cmxa str.cmxa dynlink.cmxa $(LINKFLAGS) $(OCAMLCMXFILES) $(EXECMXFILES) $(OCAMLDOC_LIBCMA): $(LIBCMOFILES) $(OCAMLC) -a -o $@ $(LINKFLAGS) $(OCAMLCMOFILES) $(LIBCMOFILES) diff --git a/otherlibs/labltk/examples_camltk/Makefile.nt b/otherlibs/labltk/examples_camltk/Makefile.nt index 13f27a01..d07471bc 100644 --- a/otherlibs/labltk/examples_camltk/Makefile.nt +++ b/otherlibs/labltk/examples_camltk/Makefile.nt @@ -1,4 +1,4 @@ -include ../support/Makefile.common.nt +include ../support/Makefile.common # We are using the non-installed library ! COMPFLAGS= -I ../lib -I ../camltk -I ../support diff --git a/otherlibs/labltk/examples_labltk/Makefile.nt b/otherlibs/labltk/examples_labltk/Makefile.nt index 825d9e42..261bf754 100644 --- a/otherlibs/labltk/examples_labltk/Makefile.nt +++ b/otherlibs/labltk/examples_labltk/Makefile.nt @@ -1,4 +1,4 @@ -include ../support/Makefile.common.nt +include ../support/Makefile.common # We are using the non-installed library ! COMPFLAGS= -I ../lib -I ../labltk -I ../support diff --git a/otherlibs/num/big_int.ml b/otherlibs/num/big_int.ml index 8c47f7bc..669df773 100644 --- a/otherlibs/num/big_int.ml +++ b/otherlibs/num/big_int.ml @@ -11,7 +11,7 @@ (* *) (***********************************************************************) -(* $Id: big_int.ml,v 1.24.2.1 2009/05/18 13:08:03 xleroy Exp $ *) +(* $Id: big_int.ml,v 1.24.2.2 2009/05/24 19:46:44 xleroy Exp $ *) open Int_misc open Nat @@ -378,7 +378,9 @@ let int64_of_big_int bi = else begin let i = match num_digits_big_int bi with - | 1 -> Int64.of_nativeint (nth_digit_nat_native bi.abs_value 0) + | 1 -> Int64.logand + (Int64.of_nativeint (nth_digit_nat_native bi.abs_value 0)) + 0xFFFFFFFFL | 2 -> Int64.logor (Int64.logand (Int64.of_nativeint (nth_digit_nat_native bi.abs_value 0)) diff --git a/otherlibs/num/test/test_big_ints.ml b/otherlibs/num/test/test_big_ints.ml index c9026a3f..ec95dede 100644 --- a/otherlibs/num/test/test_big_ints.ml +++ b/otherlibs/num/test/test_big_ints.ml @@ -771,12 +771,14 @@ test 3 eq_int64 (int64_of_big_int (big_int_of_string "-9223372036854775808"), -9223372036854775808L);; test 4 eq_int64 (int64_of_big_int (big_int_of_string "-9223372036854775"), -9223372036854775L);; +test 5 eq_int64 (* PR#4804 *) + (int64_of_big_int (big_int_of_string "2147483648"), 2147483648L);; let should_fail s = try ignore (int64_of_big_int (big_int_of_string s)); 0 with Failure _ -> 1;; -test 4 eq_int +test 6 eq_int (should_fail "9223372036854775808", 1);; -test 5 eq_int +test 7 eq_int (should_fail "-9223372036854775809", 1);; -test 6 eq_int +test 8 eq_int (should_fail "18446744073709551616", 1);; diff --git a/otherlibs/win32unix/createprocess.c b/otherlibs/win32unix/createprocess.c index 422c68ab..6b439f78 100644 --- a/otherlibs/win32unix/createprocess.c +++ b/otherlibs/win32unix/createprocess.c @@ -11,7 +11,7 @@ /* */ /***********************************************************************/ -/* $Id: createprocess.c,v 1.14 2008/01/11 16:13:16 doligez Exp $ */ +/* $Id: createprocess.c,v 1.14.4.1 2009/06/02 13:12:53 xleroy Exp $ */ #include #include @@ -35,15 +35,14 @@ value win_create_process_native(value cmd, value cmdline, value env, envp = NULL; } /* Prepare stdin/stdout/stderr redirection */ - GetStartupInfo(&si); - si.dwFlags |= STARTF_USESTDHANDLES; + ZeroMemory(&si, sizeof(STARTUPINFO)); + si.cb = sizeof(STARTUPINFO); + si.dwFlags = STARTF_USESTDHANDLES; si.hStdInput = Handle_val(fd1); si.hStdOutput = Handle_val(fd2); si.hStdError = Handle_val(fd3); /* If we do not have a console window, then we must create one before running the process (keep it hidden for apparence). - Also one must suppress spurious flags in si.dwFlags. - Otherwise the redirections are ignored. If we are starting a GUI application, the newly created console should not matter. */ if (win_has_console()) diff --git a/yacc/reader.c b/yacc/reader.c index 923aee23..a8f751d3 100644 --- a/yacc/reader.c +++ b/yacc/reader.c @@ -12,7 +12,7 @@ /* Based on public-domain code from Berkeley Yacc */ -/* $Id: reader.c,v 1.32 2005/10/06 06:34:51 garrigue Exp $ */ +/* $Id: reader.c,v 1.32.18.1 2009/05/20 11:58:43 doligez Exp $ */ #include #include "defs.h" @@ -163,6 +163,7 @@ char *substring (char *str, int start, int len) for (i = 0; i < len; i++){ buf[i] = str[start+i]; } + buf[i] = '\0'; /* PR#4796 */ return buf; } @@ -710,7 +711,7 @@ get_literal(void) n = cinc; s = MALLOC(n); if (s == 0) no_space(); - + for (i = 0; i < n; ++i) s[i] = cache[i]; @@ -1306,7 +1307,7 @@ loop: { ++cptr; i = get_number(); - + if (i <= 0 || i > n) unknown_rhs(i); item = pitem[nitems + i - n - 1]; @@ -1393,7 +1394,7 @@ loop: fwrite(cptr, 1, 2, f); cptr += 2; } else - if (cptr[0] == '\\' + if (cptr[0] == '\\' && isdigit((unsigned char) cptr[1]) && isdigit((unsigned char) cptr[2]) && isdigit((unsigned char) cptr[3]) -- 2.30.2