Fixes PR125.
authorMichael Starzinger <michi@complang.tuwien.ac.at>
Mon, 23 Mar 2009 23:58:04 +0000 (00:58 +0100)
committerMichael Starzinger <michi@complang.tuwien.ac.at>
Mon, 23 Mar 2009 23:58:04 +0000 (00:58 +0100)
* src/vm/method.cpp (method_load): Ignore access flags for clinit methods.

src/vm/method.cpp

index 6389a4f86b9d727792fd11b731fbdf6e51982d95..4a166020146d006377d38f33694cbeffd02b347e 100644 (file)
@@ -201,7 +201,15 @@ bool method_load(classbuffer *cb, methodinfo *m, descriptor_pool *descpool)
                }
        }
 #endif /* ENABLE_VERIFIER */
-       
+
+       /* Ignore flags for class initializer according to section 4.6
+          of "The Java Virtual Machine Specification, 2nd Edition" (see PR125). */
+
+       if (m->name == utf_clinit) {
+               m->flags &= ACC_STRICT;
+               m->flags |= ACC_STATIC;
+       }
+
        if (!(m->flags & ACC_STATIC))
                argcount++; /* count the 'this' argument */