From a6c3e4818ab8aa0996900bb53f05c80a508129e0 Mon Sep 17 00:00:00 2001 From: Justin Ethier Date: Thu, 30 Jun 2016 21:44:03 -0400 Subject: [PATCH] Prevent segfault if invalid args are given. --- cyclone.scm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cyclone.scm b/cyclone.scm index 142a39e1..1f3de525 100644 --- a/cyclone.scm +++ b/cyclone.scm @@ -365,9 +365,6 @@ (if (member "-d" args) (set! compile? #f)) ;; Debug, do not run GCC (cond - ((< (length args) 1) - (display "cyclone: no input file") - (newline)) ((or (member "-h" args) (member "--help" args)) (display " @@ -387,6 +384,10 @@ (display *version-banner*)) ((member "--autogen" args) (autogen "autogen.out")) + ((or (< (length args) 1) + (null? non-opts)) + (display "cyclone: no input file") + (newline)) (else (run-compiler non-opts compile?))))