[commit: ghc] master: Catch potential garbage after -msse. (e19ae5d)

git at git.haskell.org git at git.haskell.org
Mon Sep 23 07:58:30 CEST 2013


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/e19ae5df6c05e5fd3c691623e041b136dc5cafe9/ghc

>---------------------------------------------------------------

commit e19ae5df6c05e5fd3c691623e041b136dc5cafe9
Author: Geoffrey Mainland <gmainlan at microsoft.com>
Date:   Mon Sep 23 00:40:59 2013 -0400

    Catch potential garbage after -msse.


>---------------------------------------------------------------

e19ae5df6c05e5fd3c691623e041b136dc5cafe9
 compiler/main/CmdLineParser.hs |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/compiler/main/CmdLineParser.hs b/compiler/main/CmdLineParser.hs
index fef2701..22811d4 100644
--- a/compiler/main/CmdLineParser.hs
+++ b/compiler/main/CmdLineParser.hs
@@ -220,7 +220,8 @@ processOneArg opt_kind rest arg args
                           Just min <- parseInt min_s -> Right (f maj min, args)
                         | [maj_s] <- split '.' rest_no_eq,
                           Just maj <- parseInt maj_s -> Right (f maj 0, args)
-                        | otherwise -> Right (f 1 0, args)
+                        | null rest_no_eq -> Right (f 1 0, args)
+                        | otherwise -> Left ("malformed version argument in " ++ dash_arg)
 
 
 findArg :: [Flag m] -> String -> Maybe (String, OptKind m)




More information about the ghc-commits mailing list