This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java 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]

[gcjx] Patch: FYI: fixlet in Signature generation


I'm checking this in on the gcjx branch.

It is incorrect to generate an empty Signature attribute.  This
happens for Object.

Tom

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

	* bytecode/classwriter.cc (write): Special-case empty signature.

Index: bytecode/classwriter.cc
===================================================================
--- bytecode/classwriter.cc	(revision 108417)
+++ bytecode/classwriter.cc	(working copy)
@@ -221,8 +221,13 @@
     class_attributes.push_back (new simple_name_attribute (pool,
 							   "Deprecated"));
   if (target_15)
-    class_attributes.push_back (new utf8_attribute (pool, "Signature",
-						    the_class->get_class_signature ()));
+    {
+      std::string sig = the_class->get_class_signature ();
+      // For Object this will be the empty string.
+      if (sig != "")
+	class_attributes.push_back (new utf8_attribute (pool, "Signature",
+							sig));
+    }
 
   if (global->get_compiler ()->target_debug ())
     {


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