diff options
Diffstat (limited to 'otherlibs')
-rw-r--r-- | otherlibs/labltk/browser/lexical.ml | 2 | ||||
-rw-r--r-- | otherlibs/labltk/browser/typecheck.ml | 10 | ||||
-rw-r--r-- | otherlibs/labltk/examples_camltk/Makefile.nt | 2 | ||||
-rw-r--r-- | otherlibs/labltk/examples_labltk/Makefile.nt | 2 | ||||
-rw-r--r-- | otherlibs/num/big_int.ml | 4 | ||||
-rw-r--r-- | otherlibs/num/test/test_big_ints.ml | 8 | ||||
-rw-r--r-- | otherlibs/win32unix/createprocess.c | 7 |
7 files changed, 23 insertions, 12 deletions
diff --git a/otherlibs/labltk/browser/lexical.ml b/otherlibs/labltk/browser/lexical.ml index a2573ef7c..72f1957ec 100644 --- a/otherlibs/labltk/browser/lexical.ml +++ b/otherlibs/labltk/browser/lexical.ml @@ -39,6 +39,8 @@ let tag ?(start=tstart) ?(stop=tend) tw = let tpos c = (Text.index tw ~index:start, [`Char c]) in let text = Text.get tw ~start ~stop in let buffer = Lexing.from_string text in + Location.init buffer ""; + Location.input_name := ""; List.iter tags ~f:(fun tag -> Text.tag_remove tw ~start ~stop ~tag); let last = ref (EOF, 0, 0) in diff --git a/otherlibs/labltk/browser/typecheck.ml b/otherlibs/labltk/browser/typecheck.ml index 890fd195b..d5347ef53 100644 --- a/otherlibs/labltk/browser/typecheck.ml +++ b/otherlibs/labltk/browser/typecheck.ml @@ -46,8 +46,12 @@ let preprocess ~pp ~ext text = exception Outdated_version let parse_pp ~parse ~wrap ~ext text = + Location.input_name := ""; match !Clflags.preprocessor with - None -> parse (Lexing.from_string text) + None -> + let buffer = Lexing.from_string text in + Location.init buffer ""; + parse buffer | Some pp -> let tmpfile = preprocess ~pp ~ext text in let ast_magic = @@ -72,7 +76,9 @@ let parse_pp ~parse ~wrap ~ext text = failwith "Ocaml and preprocessor have incompatible versions" | _ -> seek_in ic 0; - parse (Lexing.from_channel ic) + let buffer = Lexing.from_channel ic in + Location.init buffer ""; + parse buffer in close_in ic; Sys.remove tmpfile; diff --git a/otherlibs/labltk/examples_camltk/Makefile.nt b/otherlibs/labltk/examples_camltk/Makefile.nt index 13f27a01d..d07471bc0 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 825d9e42b..261bf7543 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 933721ca5..9c74eb4c8 100644 --- a/otherlibs/num/big_int.ml +++ b/otherlibs/num/big_int.ml @@ -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 572b86863..8fdd04b40 100644 --- a/otherlibs/num/test/test_big_ints.ml +++ b/otherlibs/num/test/test_big_ints.ml @@ -771,14 +771,16 @@ 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);; (* build a 128-bit big int from two int64 *) diff --git a/otherlibs/win32unix/createprocess.c b/otherlibs/win32unix/createprocess.c index d91d707b4..042eaef9e 100644 --- a/otherlibs/win32unix/createprocess.c +++ b/otherlibs/win32unix/createprocess.c @@ -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()) |