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]

Patch: Java - Partially Fix PR java/11117


Hi,

  This patch proposes to fix the ICE in PR java/11117.

The originally reported ICE was the same as that in PR 13948 - once
that was fixed, this PR yielded another ICE which this patch
proposes to fix. After this ICE is fixed, the PR *still* manages
to fail with a verifier error, so it can't be closed just yet. :-(

The build script in the PR tries to compile a Java source
file "DOMSample.java" and a couple of JARs on the same command
line. Now DOMSample.java is parsed in the first parsing pass
and added to all_class_list, but not everything is completely
resolved until the second parsing pass - meanwhile,
java_layout_seen_class_methods() is called while parsing the JAR
classes and tries to lay out this class as well and fails as there
is no parser context when in find_in_imports() (via do_resolve_class()).

Later on, this class would be laid out anyway, so it is not
time yet to lay out the class. This patch prevents us from trying
to lay out the methods of a source file based class while there
is no parser context - it's pointless.

(Actually, we lay out the methods for classes in all_class_list
again and again and again - why?)

Tested on i686-pc-linux-gnu with the libjava and Jacks testsuites.

OK for mainline?

Ranjit.

Index: ChangeLog
from  Ranjit Mathew  <rmathew@hotmail.com>

        Partially fixes PR java/11117
        * parse.y (java_layout_seen_class_methods): Lay out methods
        for a class only if it was loaded from a class file or there
        is a parser context.

Index: parse.y
===================================================================
--- parse.y     2004-06-20 21:21:26.000000000 +0530
+++ parse.y     2004-06-20 23:08:45.000000000 +0530
@@ -7593,7 +7593,8 @@ java_layout_seen_class_methods (void)
           if (! CLASS_LOADED_P (cls))
             load_class (cls, 0);

-          layout_class_methods (cls);
+          if (! CLASS_FROM_SOURCE_P (cls) || ctxp)
+            layout_class_methods (cls);
         }

       /* Note that new classes might have been added while laying out


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