[gcjx] Patch: FYI: correctly register copied variables

Tom Tromey tromey@redhat.com
Fri Sep 16 18:34:00 GMT 2005


I'm checking this in on the gcjx branch.

We weren't registering fields which were copies of final local
variables in the class' field_map.  This resulted in the gcjx verifier
not being able to find certain fields (when generating code with
-fverify enabled), yielding incorrect errors.

All the remaining -fverify messages that come when compiling Classpath
are of the same form; these seem to be another internal bug in gcjx
(and not a bug in the actual code generation).

Tom

Index: ChangeLog
from  Tom Tromey  <tromey@redhat.com>

	* model/class.cc (add_captured_variable): Update field_map.

Index: model/class.cc
===================================================================
RCS file: /cvs/gcc/gcc/gcjx/model/Attic/class.cc,v
retrieving revision 1.1.2.13
diff -u -r1.1.2.13 class.cc
--- model/class.cc 14 Jul 2005 16:26:55 -0000 1.1.2.13
+++ model/class.cc 16 Sep 2005 18:31:14 -0000
@@ -618,9 +618,9 @@
   // Push on the front so we walk in reverse order later.
   captured_variables.push_front (var);
 
-  // Ensure users can find out about the field.  For now we don't
-  // bother with field_map.
+  // Ensure users can find out about the field.
   fields.push_back (field);
+  field_map.insert (std::make_pair (name, field.get ()));
 
   return field;
 }



More information about the Java-patches mailing list