public inbox for java-prs@sourceware.org
help / color / mirror / Atom feed
From: "thebohemian at gmx dot net" <gcc-bugzilla@gcc.gnu.org>
To: java-prs@gcc.gnu.org
Subject: [Bug libgcj/17021] libgcj verifier resolves classes too eagerly
Date: Wed, 19 Oct 2005 16:14:00 -0000	[thread overview]
Message-ID: <20051019161452.11561.qmail@sourceware.org> (raw)
In-Reply-To: <bug-17021-6651@http.gcc.gnu.org/bugzilla/>



------- 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


  parent reply	other threads:[~2005-10-19 16:14 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-17021-6651@http.gcc.gnu.org/bugzilla/>
2005-10-16  0:44 ` thebohemian at gmx dot net
2005-10-18  0:18 ` thebohemian at gmx dot net
2005-10-18  0:19 ` thebohemian at gmx dot net
2005-10-18 16:38 ` thebohemian at gmx dot net
2005-10-18 16:40 ` thebohemian at gmx dot net
2005-10-18 17:01 ` thebohemian at gmx dot net
2005-10-18 17:09 ` thebohemian at gmx dot net
2005-10-19 16:14 ` thebohemian at gmx dot net [this message]
2005-10-21 16:13 ` thebohemian at gmx dot net
2005-10-21 16:15 ` thebohemian at gmx dot net
2005-10-25 20:36 ` mckinlay at redhat dot com
2005-10-30 19:14 ` thebohemian at gmx dot net
2006-02-21 10:37 ` thebohemian at gmx dot net

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20051019161452.11561.qmail@sourceware.org \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=java-prs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).