------- 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