This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
PR33727 - Segfault with ugly string array constructor
- From: "Paul Richard Thomas" <paul dot richard dot thomas at gmail dot com>
- To: "Tobias Schlüter" <tobias dot schlueter at physik dot uni-muenchen dot de>
- Cc: "fortran at gcc dot gnu dot org" <fortran at gcc dot gnu dot org>
- Date: Thu, 11 Oct 2007 09:25:20 +0200
- Subject: PR33727 - Segfault with ugly string array constructor
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:mime-version:content-type:content-transfer-encoding:content-disposition; bh=CuNgeU8pZYm3IYRwcLQbF3g6UN66Oe+yirACM+n7n8s=; b=o4OzSZaKnYyZ7apSTzE6qaDQg0IeRUASv4UPZ0Qeua/ntVv8N+wMfqKiY1AhBOlq6PmwLUvKrO5OSG0QOycAZ6FrFUfy+0xp98wqZPD12CEA92S27mhUp9ibkWC1GpcwSaf0OP0ehWBq/ZHJTHHv2jOY0jUGurKmjaK76aT23tw=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:mime-version:content-type:content-transfer-encoding:content-disposition; b=GuYp7ubnbWSx6/AwVdTQJ78mzw/IupMBpRdhRq1X6ysj5fiPN9fUOmG6IfD4b405oZg64VYd+YGlGn4CYtnwWFshACpgaK3FmOjJJ8kGX7T+57oW3Y01xTYCZZUplQ3C7fNTC84KY4Naa7zoNP8Wk1UJHnjv97V/Cj123y5/x/o=
Tobi,
The cause of this PR is a typo in trans-array.c(get_array_ctor_var_strlen).
Index: gcc/fortran/trans-array.c
===================================================================
*** gcc/fortran/trans-array.c (révision 129121)
--- gcc/fortran/trans-array.c (copie de travail)
*************** get_array_ctor_var_strlen (gfc_expr * ex
*** 1340,1346 ****
case REF_SUBSTRING:
if (ref->u.ss.start->expr_type != EXPR_CONSTANT
! || ref->u.ss.start->expr_type != EXPR_CONSTANT)
break;
mpz_init_set_ui (char_len, 1);
mpz_add (char_len, char_len, ref->u.ss.end->value.integer);
--- 1340,1346 ----
case REF_SUBSTRING:
if (ref->u.ss.start->expr_type != EXPR_CONSTANT
! || ref->u.ss.end->expr_type != EXPR_CONSTANT)
break;
mpz_init_set_ui (char_len, 1);
mpz_add (char_len, char_len, ref->u.ss.end->value.integer);
I'm struggling to find the time to get some other patches out of the
door. If you want to fix this one, please go ahead and do so.
Cheers
Paul
--
The knack of flying is learning how to throw yourself at the ground and miss.
--Hitchhikers Guide to the Galaxy