This is the mail archive of the gcc-bugs@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]
Other format: [Raw text]

[Bug fortran/35627] [4.3, 4.4 regression] namelist read error



------- Comment #10 from jvdelisle at gcc dot gnu dot org  2008-03-20 01:17 -------
Created an attachment (id=15348)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=15348&action=view)
A final patch

l_push_char assumes the index which is item_count has been set to zero and
after saving a character it bumps the index.  This bug has been latent for a
long time, Forgot to set item_count back to zero when when freeing the
line_buffer.

The simplest fix is this:

@@ -741,6 +742,7 @@ read_logical (st_parameter_dt *dtp, int

  bad_logical:

+  dtp->u.p.item_count = 0;
   free_line (dtp);

   if (nml_bad_return (dtp, c))

However, I am going to move this reseting into free_line where it ought to be. 
The attachment is the final fix with some cleanup.  Regression tested on
x86-64.  I will commit as obvious with the new test case.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35627


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