PR java/25366: ICE in do_resolve_class

Andrew Haley aph@redhat.com
Mon Dec 12 15:35:00 GMT 2005


This bug is fixed on 4.0 branch but not on mainline.  It was fixed on
the branch by this patch:

2005-10-01  Bryce McKinlay  <mckinlay@redhat.com>

	PR java/23891
	* parse.y (maybe_create_class_interface_decl): Set TYPE_PACKAGE for
	the newly created type. Set import lists here, not in create_class.
	(jdep_resolve_class): Set current_class.
	(do_resolve_class): Use current_class's TYPE_PACKAGE to determine 
	the current package context, not ctxp->package.
	(cicp_cache): Removed.
	(class_in_current_package): Simplify implementation using
	TYPE_PACKAGE.
	* jcf-parse.c (give_name_to_class): Set TYPE_PACKAGE.
	* java-tree.h (TYPE_PACKAGE): New macro.
	(struct lang_type): New member 'package'.
	* class.c (maybe_layout_super_class): Update current_class before
	calling do_resolve_class.

The patch to maybe_layout_super_class from 4.0 branch looks perfectly
reasonable and it fixes this problem on trunk and 4.1 branch.

Andrew.


2005-12-12  Andrew Haley  <aph@redhat.com>

	* class.c (maybe_layout_super_class): Update current_class before
	calling do_resolve_class.

Index: class.c
===================================================================
*** class.c	(revision 108234)
--- class.c	(working copy)
*************** maybe_layout_super_class (tree super_cla
*** 2081,2086 ****
--- 2081,2089 ----
  	super_class = TREE_TYPE (super_class);
        else
  	{
+ 	  /* Set the correct context for class resolution.  */
+ 	  current_class = this_class;
+ 
  	  /* do_resolve_class expects an EXPR_WITH_FILE_LOCATION, so
  	     we give it one.  */
  	  tree this_wrap = NULL_TREE;



More information about the Java-patches mailing list