This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/29713] ICE [regression, trunk, 4.2]: in gfc_set_constant_character_len decl.c:762
- From: "tobias dot burnus at physik dot fu-berlin dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 4 Nov 2006 17:24:15 -0000
- Subject: [Bug fortran/29713] ICE [regression, trunk, 4.2]: in gfc_set_constant_character_len decl.c:762
- References: <bug-29713-1719@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #1 from tobias dot burnus at physik dot fu-berlin dot de 2006-11-04 17:24 -------
Fix: Reverting the change in gcc/fortran/expr.c of the following patch (which I
don't understand):
r118338 | fxcoudert | 2006-10-31 21:15:22 +0100 (Tue, 31 Oct 2006) | 12 lines
PR fortran/29067
* expr.c (gfc_simplify_expr): NULL-terminate the substring
character constant.
--- expr.c (revision 118337)
+++ expr.c (revision 118338)
@@ -1438,7 +1438,7 @@
gfc_extract_int (p->ref->u.ss.end, &end);
s = gfc_getmem (end - start + 1);
memcpy (s, p->value.character.string + start, end - start);
- s[end] = '\0'; /* TODO: C-style string for debugging. */
+ s[end-start+1] = '\0'; /* TODO: C-style string for debugging. */
gfc_free (p->value.character.string);
p->value.character.string = s;
p->value.character.length = end - start;
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29713