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] Java front-end patch to fix a Mauve build crash.


I checking this patch in. The bug was discovered while building the
Mauve test harness (a crash was observed while compiling
gnu/testlet/java/net/DatagramPacket/DatagramPacketTest.java)

./A

Thu Jan  6 16:31:28 2000  Anthony Green  <green@cygnus.com>

        * expr.c (java_lang_expand_expr): Switch to permanent obstack
        before building constant array decl.

Index: expr.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/java/expr.c,v
retrieving revision 1.54
diff -u -p -r1.54 expr.c
--- expr.c	2000/01/06 22:06:21	1.54
+++ expr.c	2000/01/07 22:54:41
@@ -1944,8 +1944,10 @@ java_lang_expand_expr (exp, target, tmod
 	if (TREE_CONSTANT (init)
 	    && ilength >= 10 && JPRIMITIVE_TYPE_P (element_type))
 	  {
-	    tree init_decl = build_decl (VAR_DECL, generate_name (),
-					 TREE_TYPE (init));
+	    tree init_decl;
+	    push_obstacks (&permanent_obstack, &permanent_obstack);
+	    init_decl = build_decl (VAR_DECL, generate_name (),
+				    TREE_TYPE (init));
 	    pushdecl_top_level (init_decl);
 	    TREE_STATIC (init_decl) = 1;
 	    DECL_INITIAL (init_decl) = init;
@@ -1953,6 +1955,7 @@ java_lang_expand_expr (exp, target, tmod
 	    TREE_READONLY (init_decl) = 1;
 	    TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (init_decl)) = 1;
 	    make_decl_rtl (init_decl, NULL, 1);
+	    pop_obstacks ();
 	    init = init_decl;
 	  }
 	expand_assignment (build (COMPONENT_REF, TREE_TYPE (data_fld),

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