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]
Other format: [Raw text]

Patch: Re: java indirect vtable change breaks for dwarf2


Richard Henderson wrote:

>We segfault under gen_struct_or_union_type_die at 
>
>      /* We don't need to do this for function-local types.  */
>      if (! decl_function_context (TYPE_STUB_DECL (type)))
>        add_incomplete_type (type);
>
>compiling any file.  The culprit appears to be 
>
>  otable_type = make_node (RECORD_TYPE);
>  otable_ptr_type = build_pointer_type (otable_type);
>
>which doesn't have nearly enough stuff filled in to be a
>proper type.
>

Doh.  I'm checking in this patch which should fix it.

regards,

Bryce.


2001-12-16  Bryce McKinlay  <bryce@waitaki.otago.ac.nz>

	* decl.c (java_init_decl_processing): Build otable_type correctly.
	otable_decl is an otable_type.

Index: decl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/decl.c,v
retrieving revision 1.114
diff -u -r1.114 decl.c
--- decl.c	2001/12/15 08:31:48	1.114
+++ decl.c	2001/12/16 05:59:16
@@ -614,7 +614,9 @@
   dtable_type = make_node (RECORD_TYPE);
   dtable_ptr_type = build_pointer_type (dtable_type);
 
-  otable_type = make_node (RECORD_TYPE);
+  one_elt_array_domain_type = build_index_type (integer_one_node);
+  otable_type = build_array_type (integer_type_node, 
+				  one_elt_array_domain_type);
   otable_ptr_type = build_pointer_type (otable_type);
 
   method_symbol_type = make_node (RECORD_TYPE);
@@ -623,15 +625,12 @@
   PUSH_FIELD (method_symbol_type, field, "signature", utf8const_ptr_type);
   FINISH_RECORD (method_symbol_type);
 
-  one_elt_array_domain_type = build_index_type (integer_one_node);
   method_symbols_array_type = build_array_type (method_symbol_type, 
 						one_elt_array_domain_type);
   method_symbols_array_ptr_type = build_pointer_type 
 				  (method_symbols_array_type);
 
-  otable_decl = build_decl (VAR_DECL, get_identifier ("otable"), 
-			    build_array_type (integer_type_node, 
-			    one_elt_array_domain_type));
+  otable_decl = build_decl (VAR_DECL, get_identifier ("otable"), otable_type);
   DECL_EXTERNAL (otable_decl) = 1;
   TREE_STATIC (otable_decl) = 1;
   TREE_READONLY (otable_decl) = 1;

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