diff options
author | Bernhard Schommer <bernhardschommer@gmail.com> | 2016-09-20 17:16:07 +0200 |
---|---|---|
committer | Bernhard Schommer <bernhardschommer@gmail.com> | 2016-09-20 17:16:07 +0200 |
commit | 288ca8fb73c7cedbb23d1cf2d7c9eb5e430211bf (patch) | |
tree | abb9d76e22785d576b74029c5776899736cf7122 /driver/Commandline.ml | |
parent | d857db508c318887463dde2039c9bfe99cdeebfa (diff) | |
download | compcert-288ca8fb73c7cedbb23d1cf2d7c9eb5e430211bf.tar.gz compcert-288ca8fb73c7cedbb23d1cf2d7c9eb5e430211bf.zip |
Ignore also ignores the argunment. Bug 18004
Diffstat (limited to 'driver/Commandline.ml')
-rw-r--r-- | driver/Commandline.ml | 7 |
1 files changed, 6 insertions, 1 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 |