PR#7460, GPR#1011: Fix uncaught Arg.Bad exception in compenv.ml
This was a regression in 4.04.0, where passing files with unknown extension (foo.xwds) to the compiler raises an uncaught Arg.Bad exception.master
parent
f15634f562
commit
9b2b2b64f8
5
Changes
5
Changes
|
@ -313,6 +313,11 @@ Next minor version (4.04.1):
|
|||
for ocaml build with WITH_FRAME_POINTERS defined
|
||||
(Christoph Cullmann)
|
||||
|
||||
- PR#7460, GPR#1011: catch uncaught exception when unknown files are passed
|
||||
as argument (regression in 4.04.0)
|
||||
(Bernhard Schommer, review by Florian Angeletti and Gabriel Scherer,
|
||||
report by Stephen Dolan)
|
||||
|
||||
- GPR#912: Fix segfault in Unix.create_process on Windows caused by wrong header
|
||||
configuration.
|
||||
(David Allsopp)
|
||||
|
|
|
@ -129,12 +129,20 @@ let main () =
|
|||
try
|
||||
readenv ppf Before_args;
|
||||
Arg.parse_expand Options.list anonymous usage;
|
||||
Compenv.process_deferred_actions
|
||||
(ppf,
|
||||
Compile.implementation,
|
||||
Compile.interface,
|
||||
".cmo",
|
||||
".cma");
|
||||
begin try
|
||||
Compenv.process_deferred_actions
|
||||
(ppf,
|
||||
Compile.implementation,
|
||||
Compile.interface,
|
||||
".cmo",
|
||||
".cma");
|
||||
with Arg.Bad msg ->
|
||||
begin
|
||||
prerr_endline msg;
|
||||
Arg.usage Options.list usage;
|
||||
exit 2
|
||||
end
|
||||
end;
|
||||
readenv ppf Before_link;
|
||||
if
|
||||
List.length (List.filter (fun x -> !x)
|
||||
|
|
|
@ -236,15 +236,24 @@ let main () =
|
|||
let ppf = Format.err_formatter in
|
||||
try
|
||||
readenv ppf Before_args;
|
||||
Arg.parse_expand (Arch.command_line_options @ Options.list) anonymous usage;
|
||||
let spec = Arch.command_line_options @ Options.list in
|
||||
Arg.parse_expand spec anonymous usage;
|
||||
if !gprofile && not Config.profiling then
|
||||
fatal "Profiling with \"gprof\" is not supported on this platform.";
|
||||
Compenv.process_deferred_actions
|
||||
(ppf,
|
||||
Optcompile.implementation ~backend,
|
||||
Optcompile.interface,
|
||||
".cmx",
|
||||
".cmxa");
|
||||
begin try
|
||||
Compenv.process_deferred_actions
|
||||
(ppf,
|
||||
Optcompile.implementation ~backend,
|
||||
Optcompile.interface,
|
||||
".cmx",
|
||||
".cmxa");
|
||||
with Arg.Bad msg ->
|
||||
begin
|
||||
prerr_endline msg;
|
||||
Arg.usage spec usage;
|
||||
exit 2
|
||||
end
|
||||
end;
|
||||
readenv ppf Before_link;
|
||||
if
|
||||
List.length (List.filter (fun x -> !x)
|
||||
|
|
|
@ -0,0 +1,40 @@
|
|||
#**************************************************************************
|
||||
#* *
|
||||
#* OCaml *
|
||||
#* *
|
||||
#* Bernhard Schommer *
|
||||
#* *
|
||||
#* Copyright 2010 Institut National de Recherche en Informatique et *
|
||||
#* en Automatique. *
|
||||
#* *
|
||||
#* All rights reserved. This file is distributed under the terms of *
|
||||
#* the GNU Lesser General Public License version 2.1, with the *
|
||||
#* special exception on linking described in the file LICENSE. *
|
||||
#* *
|
||||
#**************************************************************************
|
||||
|
||||
BASEDIR=../..
|
||||
|
||||
|
||||
default:
|
||||
@$(OCAMLOPT) unknown-file 2>&1 | grep "don't know what to do with unknown-file"\
|
||||
> unknown-file.opt.result || true
|
||||
@$(OCAMLC) unknown-file 2>&1 | grep "don't know what to do with unknown-file" \
|
||||
> unknown-file.byte.result || true
|
||||
@for file in *.opt.reference; do \
|
||||
printf " ... testing '$$file':"; \
|
||||
$(DIFF) $$file `basename $$file reference`result >/dev/null \
|
||||
&& echo " => passed" || echo " => failed"; \
|
||||
done
|
||||
@for file in *.byte.reference; do \
|
||||
printf " ... testing '$$file':"; \
|
||||
$(DIFF) $$file `basename $$file reference`result >/dev/null \
|
||||
&& echo " => passed" || echo " => failed"; \
|
||||
done
|
||||
|
||||
promote: defaultpromote
|
||||
|
||||
clean: defaultclean
|
||||
@rm -f *.result
|
||||
|
||||
include $(BASEDIR)/makefiles/Makefile.common
|
|
@ -0,0 +1 @@
|
|||
don't know what to do with unknown-file
|
|
@ -0,0 +1 @@
|
|||
don't know what to do with unknown-file
|
Loading…
Reference in New Issue