public inbox for gcc-prs@sourceware.org help / color / mirror / Atom feed
From: Andrew Pinski <pinskia@physics.uc.edu> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, Subject: Re: libgcj/5696: natClass.cc run through superclasses of target if they exist while comparing variable types. Date: Thu, 14 Feb 2002 20:36:00 -0000 [thread overview] Message-ID: <20020215043601.28994.qmail@sources.redhat.com> (raw) The following reply was made to PR libgcj/5696; it has been noted by GNATS. From: Andrew Pinski <pinskia@physics.uc.edu> To: toddastock@yahoo.com Cc: gcc-gnats@gcc.gnu.org Subject: Re: libgcj/5696: natClass.cc run through superclasses of target if they exist while comparing variable types. Date: Thu, 14 Feb 2002 23:30:40 -0500 Your testcase looks to be the wrong one can you resend the testcase? Thanks, Andrew Pinski On Thursday, February 14, 2002, at 11:07 , toddastock@yahoo.com wrote: > >> Number: 5696 >> Category: libgcj >> Synopsis: natClass.cc run through superclasses of target if they >> exist while comparing variable types. >> Confidential: no >> Severity: serious >> Priority: medium >> Responsible: unassigned >> State: open >> Class: sw-bug >> Submitter-Id: net >> Arrival-Date: Thu Feb 14 20:16:02 PST 2002 >> Closed-Date: >> Last-Modified: >> Originator: >> Release: 3.1 20020214 (experimental) >> Organization: >> Environment: > System: Linux escher 2.4.9-21 #1 Thu Jan 17 14:16:30 EST 2002 i686 > unknown > Architecture: i686 > > > host: i686-pc-linux-gnu > build: i686-pc-linux-gnu > target: i686-pc-linux-gnu > configured with: ./configure --enable-threads=posix > --prefix=/home/tstock/local --disable-shared --enable-languages=c++,java >> Description: > It's possible that you are comparing an Object (as source) against > another builtin type like a Thread (as target). In that case the > Thread would have a superclass of Object which you have to search it's > superclasses to validate that the variables are equal. > Shouldn't Thread even if it's a builtin type register true to the > function 'isInterface()'?? Is this a bug generated by the compiler > instead? >> How-To-Repeat: > import java.io.*; > > public class TestException extends RuntimeException > { > } > import java.io.*; > import java.util.*; > > public class Test > { > > Object dummy = null; > > public static void main (String[] args) > { > > Test t = new Test( ); > try > { > t.doit( new String("") ); > } > catch( TestException e ) > { > } > } > > protected TestException dummyE() > { > return new TestException(); > } > > public void doit (String x) throws TestException > { > if( dummy != null ) > { > throw dummyE(); > } > > if( dummy != null ) > { > FileInputStream in = null; > try > { > Properties props = new Properties(); > in = new FileInputStream(x); > > Enumeration enum = props.propertyNames(); > Vector v = new Vector(); > } > catch( Exception e ) > { > throw new TestException( ); > } > finally > { > if( in != null ) > { > try > { > in.close(); > } > catch( IOException ioex ) > { > } > } > } > } > else > { > throw new TestException( ); > } > } > } >> Fix: > Possibly a non-recursive solution would be better?? > Index: java/lang/natClass.cc > =================================================================== > RCS file: /cvsroot/gcc/gcc/libjava/java/lang/natClass.cc,v > retrieving revision 1.50 > diff -u -r1.50 natClass.cc > --- java/lang/natClass.cc 21 Dec 2001 19:47:50 -0000 1.50 > +++ java/lang/natClass.cc 15 Feb 2002 03:50:28 -0000 > @@ -962,11 +962,16 @@ > } > return false; > } > // Primitive TYPE classes are only assignable to themselves. > if (__builtin_expect (target->isPrimitive(), false)) > return false; > > + if( target->getSuperclass( ) ) > + { > + return _Jv_IsAssignableFrom( source, target->getSuperclass() ); > + } > + > if (target == &ObjectClass) > { > if (source->isPrimitive()) >> Release-Note: >> Audit-Trail: >> Unformatted: > >
next reply other threads:[~2002-02-15 4:36 UTC|newest] Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top 2002-02-14 20:36 Andrew Pinski [this message] -- strict thread matches above, loose matches on Subject: below -- 2002-02-19 19:16 tromey 2002-02-19 19:16 Tom Tromey 2002-02-19 18:04 tromey 2002-02-14 21:36 Todd Stock 2002-02-14 20:16 toddastock
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=20020215043601.28994.qmail@sources.redhat.com \ --to=pinskia@physics.uc.edu \ --cc=gcc-prs@gcc.gnu.org \ --cc=nobody@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: linkBe 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).