From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12763 invoked by alias); 14 Feb 2002 18:46:03 -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 12717 invoked by uid 71); 14 Feb 2002 18:46:02 -0000 Date: Thu, 14 Feb 2002 10:46:00 -0000 Message-ID: <20020214184602.12713.qmail@sources.redhat.com> To: tromey@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: Todd Stock Subject: Re: libgcj/5670: verify.cc not properly merging states Reply-To: Todd Stock X-SW-Source: 2002-02/txt/msg00345.txt.bz2 List-Id: The following reply was made to PR libgcj/5670; it has been noted by GNATS. From: Todd Stock To: tromey@gcc.gnu.org Cc: gcc-gnats@gcc.gnu.org Subject: Re: libgcj/5670: verify.cc not properly merging states Date: Thu, 14 Feb 2002 10:38:10 -0800 As an extension to this I have another one. Is the bug the same one you mention as finding and needing fixing? I don't think this is the correct patch for the problem. I am trying to reproduce a third problem that also appears to show the same incomplete type problem. -Todd The patch to fix this: + else if (source->isInterface ()) + { + for (int i = 0; i < target->interface_count; ++i) + { + // We use a recursive call because we also need to + // check superinterfaces. + if (is_assignable_from_slow (target->interfaces[i], source)) + return true; + } + target = target->getSuperclass (); + if (target == NULL) + return true; *^^^^^^^^^^^^^^^^^^^^^^^^^ return true instead of false. + } The code that produces the bug: import java.io.*; import java.util.*; public class Test2 { Vector v = new Vector( ); public void addBuildListener( TestListener l ) { v.addElement( l ); } } import java.io.*; import java.util.*; public class Test { Object x = null; int y = 0; public static void main (String[] args) { Test t = new Test( ); try { t.doit( ); } catch( Exception e ) { } } private void doit( ) throws Exception { final Test2 t = new Test2(); addListener(t); } protected void addListener( Test2 t ) { t.addBuildListener(doitSub()); } private TestLogger testE () throws IOException { return new TestLoggerDefault(); } private TestLogger doitSub () { TestLogger logger = null; if( x != null ) { try { logger = testE(); } catch( IOException e ) { throw new RuntimeException( ); } catch( Exception e ) { throw new RuntimeException( ); } } else { logger = new TestLoggerDefault( ); } logger.print(y); return logger; } } public interface TestListener { } public class TestLoggerDefault implements TestLogger { public void print ( int y ) { } } public interface TestLogger extends TestListener { void print ( int y ); } _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com