This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
[ecj] Patch: FYI: fix runtime crash
- From: Tom Tromey <tromey at redhat dot com>
- To: Java Patch List <java-patches at gcc dot gnu dot org>
- Cc: Gcc Patch List <gcc-patches at gcc dot gnu dot org>
- Date: 13 Jun 2006 08:43:34 -0600
- Subject: [ecj] Patch: FYI: fix runtime crash
- Reply-to: tromey at redhat dot com
I'm checking this in on the gcj-eclipse branch.
This fixes a runtime crash. When I rewrote is_compiled_class I
removed this check. It turns out that without this check we will
silently miscompile class files with -findirect-dispatch in some
situations -- we'll emit them as if their superclass was Object.
This fixes many, but not all, of the execution tests from the test
suite.
Tom
Index: ChangeLog
from Tom Tromey <tromey@redhat.com>
* class.c (is_compiled_class): Explicitly check for current
class.
Index: class.c
===================================================================
--- class.c (revision 114451)
+++ class.c (working copy)
@@ -2074,6 +2074,10 @@
return 1;
if (TYPE_ARRAY_P (class))
return 0;
+ /* We have to check this explicitly to avoid trying to load a class
+ that we're currently parsing. */
+ if (class == current_class)
+ return 2;
seen_in_zip = (TYPE_JCF (class) && JCF_SEEN_IN_ZIP (TYPE_JCF (class)));
if (CLASS_FROM_CURRENTLY_COMPILED_P (class))