[m-rev.] trivial diff: fix compiler abort on invalid options

Simon Taylor stayl at cs.mu.OZ.AU
Mon May 6 16:54:07 AEST 2002


Estimated hours taken: 0.1
Branches: main

compiler/mercury_compile.m:
	Don't attempt to look up an option if there were errors 
	parsing the options -- the globals won't be set.

Index: mercury_compile.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/mercury_compile.m,v
retrieving revision 1.248
diff -u -u -r1.248 mercury_compile.m
--- mercury_compile.m	3 May 2002 06:52:22 -0000	1.248
+++ mercury_compile.m	6 May 2002 06:50:51 -0000
@@ -135,19 +135,24 @@
 		{ MaybeMCFlags = yes(MCFlags) },
 		handle_options(MCFlags ++ Args0, MaybeError,
 	    		OptionArgs0, NonOptionArgs, Link),
-		
-		%
-		% When computing the option arguments to pass
-		% to `--make', only include the command-line
-		% arguments, not the contents of DEFAULT_MCFLAGS.
-		%
-		globals__io_lookup_bool_option(make, Make),
-		{ Make = yes ->
-			process_options(Args0, OptionArgs, _, _)
+		(
+			{ MaybeError = no },
+			%
+			% When computing the option arguments to pass
+			% to `--make', only include the command-line
+			% arguments, not the contents of DEFAULT_MCFLAGS.
+			%
+			globals__io_lookup_bool_option(make, Make),
+			{ Make = yes ->
+				process_options(Args0, OptionArgs, _, _)
+			;
+				% OptionArgs is only used with `--make'.
+				OptionArgs = OptionArgs0
+			}
 		;
-			% OptionArgs is only used with `--make'.
-			OptionArgs = OptionArgs0
-		},
+			{ MaybeError = yes(_) },
+			{ OptionArgs = OptionArgs0 }
+		),
 		main_2(MaybeError, OptionArgs, NonOptionArgs, Link)
 	;
 		{ MaybeMCFlags = no },
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list