public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: libgcj/5696: natClass.cc run through superclasses of target if they exist while comparing variable types.
@ 2002-02-19 19:16 tromey
0 siblings, 0 replies; 6+ messages in thread
From: tromey @ 2002-02-19 19:16 UTC (permalink / raw)
To: gcc-bugs, gcc-prs, java-prs, toddastock, tromey
Synopsis: natClass.cc run through superclasses of target if they exist while comparing variable types.
State-Changed-From-To: analyzed->closed
State-Changed-By: tromey
State-Changed-When: Tue Feb 19 19:11:38 2002
State-Changed-Why:
I'm checking in the fix.
I sent a fuller explanation via email.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=5696
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: libgcj/5696: natClass.cc run through superclasses of target if they exist while comparing variable types.
@ 2002-02-19 19:16 Tom Tromey
0 siblings, 0 replies; 6+ messages in thread
From: Tom Tromey @ 2002-02-19 19:16 UTC (permalink / raw)
To: tromey; +Cc: gcc-prs
The following reply was made to PR libgcj/5696; it has been noted by GNATS.
From: Tom Tromey <tromey@redhat.com>
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: 19 Feb 2002 20:36:11 -0700
>>>>> "Todd" == Todd Stock <toddastock@yahoo.com> writes:
Todd> It's possible that you are comparing an Object (as source)
Todd> against another builtin type like a Thread (as target). In that
Todd> case the Thread would have a superclass of Object which you have
Todd> to search it's superclasses to validate that the variables are
Todd> equal.
_Jv_IsAssignableFrom does this using the ancestor tables. So no
recursion is necessary, and I think your patch isn't addressing the
real problem.
I do think it makes sense for the verifier not to use _Jv_IsAssignableFrom.
So I made this change.
Todd> Shouldn't Thread even if it's a builtin type register true to
Todd> the function 'isInterface()'??
Thread is not an interface, so isInterface should return false.
I looked into this PR today. I think the problem was in our handling
of subroutines. We would erroneously mark a variable as changed even
if all that happened was a simple merge due to the subroutine being
called from different places -- i.e., it could be marked as merged
even though it wasn't actually modified by the subroutine.
Tom
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: libgcj/5696: natClass.cc run through superclasses of target if they exist while comparing variable types.
@ 2002-02-19 18:04 tromey
0 siblings, 0 replies; 6+ messages in thread
From: tromey @ 2002-02-19 18:04 UTC (permalink / raw)
To: gcc-bugs, gcc-prs, java-prs, nobody, toddastock, tromey
Synopsis: natClass.cc run through superclasses of target if they exist while comparing variable types.
Responsible-Changed-From-To: unassigned->tromey
Responsible-Changed-By: tromey
Responsible-Changed-When: Tue Feb 19 16:06:22 2002
Responsible-Changed-Why:
I'm handling this.
State-Changed-From-To: open->analyzed
State-Changed-By: tromey
State-Changed-When: Tue Feb 19 16:06:22 2002
State-Changed-Why:
The problem here is in the verifier, not natClass.cc.
There are at least two bugs (I think).
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=5696
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: libgcj/5696: natClass.cc run through superclasses of target if they exist while comparing variable types.
@ 2002-02-14 21:36 Todd Stock
0 siblings, 0 replies; 6+ messages in thread
From: Todd Stock @ 2002-02-14 21:36 UTC (permalink / raw)
To: nobody; +Cc: gcc-prs
The following reply was made to PR libgcj/5696; it has been noted by GNATS.
From: Todd Stock <toddastock@yahoo.com>
To: Andrew Pinski <pinskia@physics.uc.edu>
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 21:29:15 -0800
This is a multi-part message in MIME format.
--------------000502030109070908060801
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Treat it like two file. Test.java and TestException.java. The split is
on the new import line after the definition of TestException class. I
am sending the two files again as attachments this time just in case.
-Todd
Andrew Pinski wrote:
> Your testcase looks to be the wrong one can you resend the testcase?
>
--------------000502030109070908060801
Content-Type: text/plain;
name="Test.java"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="Test.java"
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( );
}
}
}
--------------000502030109070908060801
Content-Type: text/plain;
name="TestException.java"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="TestException.java"
import java.io.*;
public class TestException extends RuntimeException
{
}
--------------000502030109070908060801--
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: libgcj/5696: natClass.cc run through superclasses of target if they exist while comparing variable types.
@ 2002-02-14 20:36 Andrew Pinski
0 siblings, 0 replies; 6+ messages in thread
From: Andrew Pinski @ 2002-02-14 20:36 UTC (permalink / raw)
To: nobody; +Cc: gcc-prs
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:
>
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* libgcj/5696: natClass.cc run through superclasses of target if they exist while comparing variable types.
@ 2002-02-14 20:16 toddastock
0 siblings, 0 replies; 6+ messages in thread
From: toddastock @ 2002-02-14 20:16 UTC (permalink / raw)
To: gcc-gnats
>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:
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2002-02-20 3:16 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-02-19 19:16 libgcj/5696: natClass.cc run through superclasses of target if they exist while comparing variable types tromey
-- strict thread matches above, loose matches on Subject: below --
2002-02-19 19:16 Tom Tromey
2002-02-19 18:04 tromey
2002-02-14 21:36 Todd Stock
2002-02-14 20:36 Andrew Pinski
2002-02-14 20:16 toddastock
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).