[gcjx] Patch: FYI: fix implicit field qualifiers

Tom Tromey tromey@redhat.com
Sat Jan 15 22:35:00 GMT 2005


I'm checking this in on the gcjx branch.

The implicit qualifier of a field reference is the current class, not
the field's declaring class.  This fixes a jacks failure.

Tom

Index: model/fieldref.cc
===================================================================
RCS file: /cvs/gcc/gcc/gcjx/model/Attic/fieldref.cc,v
retrieving revision 1.1.2.1
diff -u -r1.1.2.1 fieldref.cc
--- model/fieldref.cc 13 Jan 2005 03:18:36 -0000 1.1.2.1
+++ model/fieldref.cc 15 Jan 2005 22:32:55 -0000
@@ -1,6 +1,6 @@
 // Field references.
 
-// Copyright (C) 2004 Free Software Foundation, Inc.
+// Copyright (C) 2004, 2005 Free Software Foundation, Inc.
 //
 // This file is part of GCC.
 //
@@ -169,7 +169,11 @@
   if (expression)
     qualifier = assert_cast<model_class *> (expression->type ());
   else
-    qualifier = field->get_declaring_class ();
+    {
+      // This is an unqualified reference to a field.  In this case we
+      // use the implicit qualifier, which is the current class.
+      qualifier = scope->get_current_class ();
+    }
 
   set_type (field->type ());
 }



More information about the Java-patches mailing list