This is the mail archive of the
java-prs@gcc.gnu.org
mailing list for the Java project.
[Bug libgcj/17021] libgcj verifier resolves classes too eagerly
- From: "thebohemian at gmx dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: java-prs at gcc dot gnu dot org
- Date: 19 Oct 2005 16:14:52 -0000
- Subject: [Bug libgcj/17021] libgcj verifier resolves classes too eagerly
- References: <bug-17021-6651@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #11 from thebohemian at gmx dot net 2005-10-19 16:14 -------
In the JavaUtils class of axis 1.2 RC2 contains the following instruction:
639: invokevirtual <Method javax.activation.DataHandler.getContent
()java.lang.Object>
With a missing DataHandler class file this JavaUtils class can be verified
successfully on sun' s jvm but fails at this instruction on gij.
I traced the problem back to a call to in
_Jv_BytecodeVerifier::ref_intersection::compatible(_Jv_BytecodeVerifier::ref_intersection*,
_Jv_BytecodeVerifier*)
In that method the names of the two classes (which are not resolved) are the
following:
(gdb) putf self->data.name
$152 = 0x121054 "javax.activation.DataHandler"
(gdb) putf other_iter->data.name
$153 = 0x80736ac "Ljavax.activation.DataHandler;"
Obviously this denotes the same classnames but for Jv_equalUtf8Consts which is
called in _Jv_BytecodeVerifier::ref_intersection::compatible() the strings are
different.
I propose to fix the problem in the following way: Instead of
if (! self->is_resolved
&& ! other_iter->is_resolved
&& _Jv_equalUtf8Consts (self->data.name,
other_iter->data.name))
do
if (! self->is_resolved
&& ! other_iter->is_resolved
&& ( _Jv_equalUtf8Consts (self->data.name, other_iter->data.name) ||
match_classname(self->data.name, other_iter->data.name ) )
match_classname is then implemented in a way that it would accept all these
names as equal:
java/lang/Class
Ljava/lang/Class;
java.lang.Class
Ljava.lang.Class;
However there might be another approach to the problem: One could make sure
that class names in _Jv_UTF8_Const objects are always in the
Lp1/p2/p3/classname; form.
Please comment.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17021