aboutsummaryrefslogtreecommitdiffstats
path: root/driver
diff options
context:
space:
mode:
authorBernhard Schommer <bernhardschommer@gmail.com>2016-09-20 17:16:07 +0200
committerBernhard Schommer <bernhardschommer@gmail.com>2016-09-20 17:16:07 +0200
commit288ca8fb73c7cedbb23d1cf2d7c9eb5e430211bf (patch)
treeabb9d76e22785d576b74029c5776899736cf7122 /driver
parentd857db508c318887463dde2039c9bfe99cdeebfa (diff)
downloadcompcert-288ca8fb73c7cedbb23d1cf2d7c9eb5e430211bf.tar.gz
compcert-288ca8fb73c7cedbb23d1cf2d7c9eb5e430211bf.zip
Ignore also ignores the argunment. Bug 18004
Diffstat (limited to 'driver')
-rw-r--r--driver/Commandline.ml7
-rw-r--r--driver/Commandline.mli2
2 files changed, 7 insertions, 2 deletions
diff --git a/driver/Commandline.ml b/driver/Commandline.ml
index ce5acf9d..c0dd6257 100644
--- a/driver/Commandline.ml
+++ b/driver/Commandline.ml
@@ -98,7 +98,12 @@ let parse_array spec argv first last =
end else begin
eprintf "Option `%s' expects an argument\n" s; exit 2
end
- | Some (Ignore) -> parse (i+1)
+ | Some (Ignore) ->
+ if i + 1 <= last then begin
+ parse (i+2)
+ end else begin
+ eprintf "Option `%s' expects an argument\n" s; exit 2
+ end
| Some (Unit f) -> f (); parse (i+1)
end
in parse first
diff --git a/driver/Commandline.mli b/driver/Commandline.mli
index 5f9d8704..197d0b04 100644
--- a/driver/Commandline.mli
+++ b/driver/Commandline.mli
@@ -33,7 +33,7 @@ type action =
| Self of (string -> unit) (** call the function with the matched string *)
| String of (string -> unit) (** read next arg as a string, call function *)
| Integer of (int -> unit) (** read next arg as an int, call function *)
- | Ignore (** ignore the arg *)
+ | Ignore (** ignore the next arg *)
| Unit of (unit -> unit) (** call the function with unit as argument *)
val parse_cmdline: (pattern * action) list -> unit