This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Patch: missing `break' in gcc.c


I believe there is a missing `break' in handle_braces() in gcc.c.
Without this patch, `i' will always be `n_switches' after the loop
finishes.  I think this will result in an incorrect call to
give_switch().

I found this by inspection.  I don't have a test case.

2000-03-27  Tom Tromey  <tromey@cygnus.com>

	* gcc.c (handle_braces): In {x*...} case, break out of loop if
	switch is found.

Tom

Index: gcc.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/gcc.c,v
retrieving revision 1.135
diff -c -r1.135 gcc.c
*** gcc.c	2000/03/26 23:23:01	1.135
--- gcc.c	2000/03/27 18:57:49
***************
*** 4778,4783 ****
--- 4778,4784 ----
  		  && check_live_switch (i, hard_match_len))
  		{
  		  present = 1;
+ 		  break;
  		}
  	    }
  	}

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]