This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: endless loop in jc1


Alexandre Oliva <aoliva@cygnus.com> writes:


> I've stumbled across this one while building GCC+libgcj with current
> CVS.  Ok to install?
> ...
> Index: gcc/java/ChangeLog
> from  Alexandre Oliva  <oliva@lsd.ic.unicamp.br>
> 
> 	* jcf-write.c (generate_classfile): Scan the source_file for
> 	slashes with the right pointer variable.

Yes. The bug was introduced by Zack's last `char *' constify
patch:

  apbianco@kazmo[~/src/egcs/gcc/java]: cvs diff -r1.54 -r1.53 jcf-write.c
  ...
  @@ -3064,13 +3064,13 @@ generate_classfile (clas, state)
     ptr = methods_count_ptr;  UNSAFE_PUT2 (methods_count);
   
     source_file = DECL_SOURCE_FILE (TYPE_NAME (clas));
  -  for (ptr = source_file;  ;  ptr++)
  +  for (s = source_file; ; s++)
       {
         char ch = *ptr;
         if (ch == '\0')
          break;
         if (ch == '/' || ch == '\\')
  -       source_file = ptr+1;
  +       source_file = s+1;
       }
     ptr = append_chunk (NULL, 10, state);

I didn't get a chance to review is patch (IFAIR.) Thank you for
tracking this down.

./A



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]