This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
[gcjx] Patch: FYI: bug fix when computing signature
- From: Tom Tromey <tromey at redhat dot com>
- To: Java Patch List <java-patches at gcc dot gnu dot org>
- Date: 12 Feb 2005 20:25:51 -0700
- Subject: [gcjx] Patch: FYI: bug fix when computing signature
- Reply-to: tromey at redhat dot com
I'm checking this in on the gcjx branch.
gcjx would crash when computing the signature of Object. This patch
fixes the bug.
Tom
#
# patch "gcc/gcjx/ChangeLog"
# from [d62003800daa04399c7ce22ba417bd3e97e33d45]
# to [87627bf07fb946a7107a8ecb06d270517023a03c]
#
# patch "gcc/gcjx/model/class.cc"
# from [0045d34dce95f5f72df0b8e583681dc6638b6994]
# to [5998130add48b3794bc822629eee09f320a34718]
#
--- gcc/gcjx/ChangeLog
+++ gcc/gcjx/ChangeLog
@@ -1,5 +1,7 @@
2005-02-04 Tom Tromey <tromey@redhat.com>
+ * model/class.cc (get_class_signature): Handle Object case.
+
* model/import.cc (resolve): New method.
* model/import.hh (model_static_import_single::resolve): Declare.
--- gcc/gcjx/model/class.cc
+++ gcc/gcjx/model/class.cc
@@ -390,9 +390,13 @@
{
std::string result;
result = type_parameters.get_signature ();
- model_type *sup = (interface ? global->get_compiler ()->java_lang_Object ()
- : superclass->type ());
- result += sup->get_signature ();
+ model_type *sup = NULL;
+ if (interface)
+ sup = global->get_compiler ()->java_lang_Object ();
+ else if (superclass)
+ sup = superclass->type ();
+ if (sup)
+ result += sup->get_signature ();
for (std::list<ref_forwarding_type>::const_iterator i = interfaces.begin ();
i != interfaces.end ();
++i)