[gfortran,commited] Fix for PR 29713

FX Coudert fxcoudert@gmail.com
Sat Nov 4 21:05:00 GMT 2006


Hi all,

I commited the following fix for PR 29713, a stupid bug arising from  
my NULL-termination patch, on mainline. I'll be waiting for  
objections and to see if something happens before backporting it to  
4.2 and 4.1.


Index: gcc/fortran/expr.c
===================================================================
--- gcc/fortran/expr.c  (revision 118455)
+++ gcc/fortran/expr.c  (working copy)
@@ -1436,7 +1436,7 @@
           gfc_extract_int (p->ref->u.ss.start, &start);
           start--;  /* Convert from one-based to zero-based.  */
           gfc_extract_int (p->ref->u.ss.end, &end);
-         s = gfc_getmem (end - start + 1);
+         s = gfc_getmem (end - start + 2);
           memcpy (s, p->value.character.string + start, end - start);
           s[end-start+1] = '\0';  /* TODO: C-style string for  
debugging.  */
           gfc_free (p->value.character.string);



More information about the Fortran mailing list