public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: libgcj/5671: verify.cc problem merging local variables
@ 2002-02-13  9:16 Tom Tromey
  0 siblings, 0 replies; 4+ messages in thread
From: Tom Tromey @ 2002-02-13  9:16 UTC (permalink / raw)
  To: tromey; +Cc: gcc-prs

The following reply was made to PR libgcj/5671; 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/5671: verify.cc problem merging local variables
Date: 13 Feb 2002 10:34:02 -0700

 >>>>> "Todd" == Todd Stock <toddastock@yahoo.com> writes:
 
 Todd> Number:         5671
 Todd> Synopsis:       verify.cc problem merging local variables
 
 Todd> 	During the merging of the local variables if the previous
 Todd> variable is an interface then running through the superclasses
 Todd> leads you directly to NULL eventually thus causing a
 Todd> segmentation fault.
 
 Thanks for the report and the test case.  I've converted the latter
 into a Mauve verifier regression test and checked it in.  I'm also
 checking in a slightly modified version of your patch.  I think after
 the loop, if `k == NULL', then the merge result should be Object and
 not `old_type'.
 
 Tom


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: libgcj/5671: verify.cc problem merging local variables
@ 2002-02-13  9:15 tromey
  0 siblings, 0 replies; 4+ messages in thread
From: tromey @ 2002-02-13  9:15 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, java-prs, nobody, toddastock, tromey

Synopsis: verify.cc problem merging local variables

Responsible-Changed-From-To: unassigned->tromey
Responsible-Changed-By: tromey
Responsible-Changed-When: Wed Feb 13 09:15:33 2002
Responsible-Changed-Why:
    I've handled this.
State-Changed-From-To: open->closed
State-Changed-By: tromey
State-Changed-When: Wed Feb 13 09:15:33 2002
State-Changed-Why:
    I've checked in the patch.
    Thanks once again.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=5671


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: libgcj/5671: verify.cc problem merging local variables
@ 2002-02-12 11:06 Todd Stock
  0 siblings, 0 replies; 4+ messages in thread
From: Todd Stock @ 2002-02-12 11:06 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR libgcj/5671; it has been noted by GNATS.

From: Todd Stock <toddastock@yahoo.com>
To: toddastock@yahoo.com
Cc: gcc-gnats@gcc.gnu.org
Subject: Re: libgcj/5671: verify.cc problem merging local variables
Date: Tue, 12 Feb 2002 10:59:05 -0800

 Unidiffs for bugs 5669/5670/5671.
 
 Index: verify.cc
 ===================================================================
 RCS file: /cvsroot/gcc/gcc/libjava/verify.cc,v
 retrieving revision 1.35
 diff -u -r1.35 verify.cc
 --- verify.cc	7 Feb 2002 02:27:10 -0000	1.35
 +++ verify.cc	12 Feb 2002 18:50:09 -0000
 @@ -259,6 +259,19 @@
  	    if (source == NULL)
  	      return false;
  	  }
 +	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 false;
 +	  }
  	else if (target == &java::lang::Object::class$)
  	  return true;
  	else if (source->isInterface ()
 @@ -676,7 +689,7 @@
  		    }
  
  		  // This loop will end when we hit Object.
 -		  while (true)
 +		  while (true && k!=NULL)
  		    {
  		      if (is_assignable_from_slow (k, oldk))
  			break;
 @@ -684,6 +697,12 @@
  		      changed = true;
  		    }
  
 +		  if( k == NULL )
 +		    {
 +		      *this = old_type;
 +		      changed = true;
 +		    }
 +		  else
  		  if (changed)
  		    {
  		      while (arraycount > 0)
 @@ -1943,9 +1962,11 @@
      return type (k);
    }
  
 -  void compute_argument_types (_Jv_Utf8Const *signature,
 -			       type *types)
 +  type *compute_argument_types (_Jv_Utf8Const *signature,
 +			       int arg_count)
    {
 +    if( arg_count == 0 ) return NULL;
 +    type *types=new type[arg_count];
      char *p = signature->data;
      // Skip `('.
      ++p;
 @@ -1953,6 +1974,7 @@
      int i = 0;
      while (*p != ')')
        types[i++] = get_one_type (p);
 +    return types;
    }
  
    type compute_return_type (_Jv_Utf8Const *signature)
 @@ -1994,8 +2016,7 @@
  
      // We have to handle wide arguments specially here.
      int arg_count = _Jv_count_arguments (current_method->self->signature);
 -    type arg_types[arg_count];
 -    compute_argument_types (current_method->self->signature, arg_types);
 +    type *arg_types = compute_argument_types( current_method->self->signature, arg_count );
      for (int i = 0; i < arg_count; ++i)
        {
  	set_variable (var, arg_types[i]);
 @@ -2004,6 +2025,8 @@
  	  ++var;
        }
  
 +    delete []arg_types;
 +
      return is_init;
    }
  
 @@ -2747,8 +2770,7 @@
  
  	      // Pop arguments and check types.
  	      int arg_count = _Jv_count_arguments (method_signature);
 -	      type arg_types[arg_count];
 -	      compute_argument_types (method_signature, arg_types);
 +              type *arg_types = compute_argument_types( method_signature, arg_count );
  	      for (int i = arg_count - 1; i >= 0; --i)
  		{
  		  // This is only used for verifying the byte for
 @@ -2756,6 +2778,7 @@
  		  nargs -= arg_types[i].depth ();
  		  pop_type (arg_types[i]);
  		}
 +              delete []arg_types;
  
  	      if (opcode == op_invokeinterface
  		  && nargs != 1)
 
 gcc-gnats@gcc.gnu.org wrote:
 
 >Thank you very much for your problem report.
 >It has the internal identification `libgcj/5671'.
 >The individual assigned to look at your
 >report is: unassigned. 
 >
 >>Category:       libgcj
 >>Responsible:    unassigned
 >>Synopsis:       verify.cc problem merging local variables
 >>Arrival-Date:   Tue Feb 12 10:26:01 PST 2002
 >>
 >
 
 
 
 
 _________________________________________________________
 Do You Yahoo!?
 Get your free @yahoo.com address at http://mail.yahoo.com
 


^ permalink raw reply	[flat|nested] 4+ messages in thread

* libgcj/5671: verify.cc problem merging local variables
@ 2002-02-12 10:26 toddastock
  0 siblings, 0 replies; 4+ messages in thread
From: toddastock @ 2002-02-12 10:26 UTC (permalink / raw)
  To: gcc-gnats


>Number:         5671
>Category:       libgcj
>Synopsis:       verify.cc problem merging local variables
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Feb 12 10:26:01 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     
>Release:        3.1 20020211 (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:
	During the merging of the local variables if the previous variable is an interface then running through the superclasses leads you directly to NULL eventually thus causing a segmentation fault.
>How-To-Repeat:
import java.io.*;
import java.util.*;

public class Test
  {

  public static void main(String[] args)
    {
      new Test().doit();
    }

  public void doit( )
    {

      String x = "abc";
      try
      {
        Properties props = new Properties();
        Enumeration enum = props.propertyNames();
      }
      catch( Exception e )
      {
      }
      String _x = "def";
      try
      {
        Properties props = new Properties();
        Enumeration enum = props.propertyNames();
      }
      catch( Exception e )
      {
      }
    }

  }
>Fix:
Index: libjava/verify.cc
===================================================================
RCS file: /cvsroot/gcc/gcc/libjava/verify.cc,v
retrieving revision 1.35
diff -r1.35 verify.cc
679c679
< 		  while (true)
---
> 		  while (true && k!=NULL)
686a687,692
> 		  if( k == NULL )
> 		    {
> 		      *this = old_type;
> 		      changed = true;
> 		    }
> 		  else
>Release-Note:
>Audit-Trail:
>Unformatted:


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2002-02-13 17:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-02-13  9:16 libgcj/5671: verify.cc problem merging local variables Tom Tromey
  -- strict thread matches above, loose matches on Subject: below --
2002-02-13  9:15 tromey
2002-02-12 11:06 Todd Stock
2002-02-12 10:26 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).