public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
From: Tobias Burnus <tobias@codesourcery.com>
To: Harald Anlauf <anlauf@gmx.de>, Tobias Burnus <tobias@codesourcery.com>
Cc: fortran <fortran@gcc.gnu.org>, gcc-patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] PR fortran/99205 - [10/11 Regression] Out of memory with undefined character length
Date: Wed, 10 Mar 2021 22:52:11 +0100	[thread overview]
Message-ID: <2cc491ad-5f5f-ffcd-4f65-72512eaf888a@codesourcery.com> (raw)
In-Reply-To: <trinity-97446242-7777-4065-a9f8-cf10c968255f-1615411598627@3c-app-gmx-bs58>

Dear Harald, dear all,

On 10.03.21 22:26, Harald Anlauf wrote:
> [...] I found another testcase which lead to trouble during error
> recovery due to a NULL pointer dereference.

I was a bit surprised that the crash only occurs in trans*.c;
however, the error 'non-constant initialization expression'
is only issued by gfc_conv_constant, called via gfc_get_symbol_decl.

Thus, when the error is shown we are already deep in trans*.c land.

>    Here's the updated changelog for the updated
> patch (attached).  I also renamed the first testcase so that they
> fit better to the existing scheme.
>
> Again regtested on x86_64-pc-linux-gnu.  Now OK for mainline / 10?

LGTM for mainline and after a bit of waiting for GCC10.

Thanks,

Tobias

> PR fortran/99205 - Out of memory with undefined character length
>
> A character variable appearing as a data statement object cannot
> be automatic, thus it shall have constant length.
>
> gcc/fortran/ChangeLog:
>
>       PR fortran/99205
>       * data.c (gfc_assign_data_value): Reject non-constant character
>       length for lvalue.
>       * trans-array.c (gfc_conv_array_initializer): Restrict loop to
>       elements which are defined to avoid NULL pointer dereference.
>
> gcc/testsuite/ChangeLog:
>
>       PR fortran/99205
>       * gfortran.dg/data_char_4.f90: New test.
>       * gfortran.dg/data_char_5.f90: New test.
>
-----------------
Mentor Graphics (Deutschland) GmbH, Arnulfstrasse 201, 80634 München Registergericht München HRB 106955, Geschäftsführer: Thomas Heurung, Frank Thürauf

      reply	other threads:[~2021-03-10 21:52 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-09 19:45 Harald Anlauf
2021-03-10 10:06 ` Tobias Burnus
2021-03-10 19:43   ` Harald Anlauf
2021-03-10 20:18     ` Tobias Burnus
2021-03-10 21:26   ` Harald Anlauf
2021-03-10 21:52     ` Tobias Burnus [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2cc491ad-5f5f-ffcd-4f65-72512eaf888a@codesourcery.com \
    --to=tobias@codesourcery.com \
    --cc=anlauf@gmx.de \
    --cc=fortran@gcc.gnu.org \
    --cc=gcc-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).