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]

[BC ABI] Check that we loaded the right class


We weren't checking that a call to read_class succeeded in reading the
actual class we asked for.

Andrew.


2004-08-06  Andrew Haley  <aph@redhat.com>

        * jcf-parse.c (load_class): Check that we really have loaded the
        class we're looking for.

Index: java/jcf-parse.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/jcf-parse.c,v
retrieving revision 1.158.4.4
diff -p -2 -c -r1.158.4.4 jcf-parse.c
*** java/jcf-parse.c	23 Jun 2004 12:22:20 -0000	1.158.4.4
--- java/jcf-parse.c	6 Aug 2004 14:50:37 -0000
*************** load_class (tree class_or_name, int verb
*** 565,569 ****
  {
    tree name, saved;
!   int class_loaded;
  
    /* We've already failed, don't try again.  */
--- 565,569 ----
  {
    tree name, saved;
!   int class_loaded = 0;
  
    /* We've already failed, don't try again.  */
*************** load_class (tree class_or_name, int verb
*** 584,587 ****
--- 584,588 ----
  
    saved = name;
+   
    while (1)
      {
*************** load_class (tree class_or_name, int verb
*** 592,600 ****
  	{
  	  tree type_decl = IDENTIFIER_CLASS_VALUE (name);
! 	  if ((class_loaded = CLASS_LOADED_P (TREE_TYPE (type_decl))))
  	    break;
  	}
! 
!       if ((class_loaded = read_class (name)))
  	break;
  
--- 593,601 ----
  	{
  	  tree type_decl = IDENTIFIER_CLASS_VALUE (name);
! 	  if (CLASS_PARSED_P (TREE_TYPE (type_decl)))
  	    break;
  	}
! 	
!       if (read_class (name))
  	break;
  
*************** load_class (tree class_or_name, int verb
*** 614,617 ****
--- 615,625 ----
      }
  
+   {
+     /* have we found the class we're looking for?  */
+     tree type_decl = IDENTIFIER_CLASS_VALUE (saved);
+     tree type = type_decl ? TREE_TYPE (type_decl) : NULL;
+     class_loaded = type && CLASS_PARSED_P (type);
+   }	      
+   
    if (!class_loaded)
      {


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