Patch: gcj PR 310

Tom Tromey tromey@cygnus.com
Sun Aug 20 09:20:00 GMT 2000


I'm checking this in with Alex's approval.

2000-08-09  Tom Tromey  <tromey@cygnus.com>

	* parse.y (patch_switch_statement): Disallow `long' in switch
	expressions.  Fixes PR gcj/310.

Tom

Index: parse.y
===================================================================
RCS file: /cvs/gcc/egcs/gcc/java/parse.y,v
retrieving revision 1.200
diff -u -r1.200 parse.y
--- parse.y	2000/08/11 22:01:37	1.200
+++ parse.y	2000/08/20 16:17:57
@@ -14413,7 +14429,7 @@
   se_type = TREE_TYPE (se);
   /* The type of the switch expression must be char, byte, short or
      int */
-  if (!JINTEGRAL_TYPE_P (se_type))
+  if (! JINTEGRAL_TYPE_P (se_type) || se_type == long_type_node)
     {
       EXPR_WFL_LINECOL (wfl_operator) = EXPR_WFL_LINECOL (node);
       parse_error_context (wfl_operator,


More information about the Gcc-patches mailing list