Prevent segfault if invalid args are given.

This commit is contained in:
Justin Ethier 2016-06-30 21:44:03 -04:00
parent 8a89678f6c
commit a6c3e4818a

View file

@ -365,9 +365,6 @@
(if (member "-d" args) (if (member "-d" args)
(set! compile? #f)) ;; Debug, do not run GCC (set! compile? #f)) ;; Debug, do not run GCC
(cond (cond
((< (length args) 1)
(display "cyclone: no input file")
(newline))
((or (member "-h" args) ((or (member "-h" args)
(member "--help" args)) (member "--help" args))
(display " (display "
@ -387,6 +384,10 @@
(display *version-banner*)) (display *version-banner*))
((member "--autogen" args) ((member "--autogen" args)
(autogen "autogen.out")) (autogen "autogen.out"))
((or (< (length args) 1)
(null? non-opts))
(display "cyclone: no input file")
(newline))
(else (else
(run-compiler non-opts compile?)))) (run-compiler non-opts compile?))))