From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12341 invoked by alias); 15 Feb 2002 04:16:06 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 12252 invoked by uid 71); 15 Feb 2002 04:16:02 -0000 Resent-Date: 15 Feb 2002 04:16:02 -0000 Resent-Message-ID: <20020215041602.12251.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-To: nobody@gcc.gnu.org Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org, java-prs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, toddastock@yahoo.com Received:(qmail 4190 invoked from network); 15 Feb 2002 04:05:58 -0000 Received: from unknown (HELO localhost.localdomain) (12.230.248.186) by sources.redhat.com with SMTP; 15 Feb 2002 04:05:58 -0000 Received: (from tstock@localhost) by localhost.localdomain (8.11.6/8.11.6) id g1F479j13955; Thu, 14 Feb 2002 20:07:09 -0800 Message-Id:<200202150407.g1F479j13955@localhost.localdomain> Date: Thu, 14 Feb 2002 20:16:00 -0000 From: toddastock@yahoo.com To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version:3.113 Subject: libgcj/5696: natClass.cc run through superclasses of target if they exist while comparing variable types. X-SW-Source: 2002-02/txt/msg00351.txt.bz2 List-Id: >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: