]> git.ipfire.org Git - thirdparty/gcc.git/commit
fortran: fix checking of CHARACTER lengths in array constructors [PR70231]
authorHarald Anlauf <anlauf@gmx.de>
Mon, 18 Sep 2023 20:11:40 +0000 (22:11 +0200)
committerHarald Anlauf <anlauf@gmx.de>
Tue, 19 Sep 2023 17:02:16 +0000 (19:02 +0200)
commit15acabb80f91b12836bcf4ffcb92ea10fe4e8272
tree792857936e925f1237d0032f0a1a0dcb82233a68
parent36eec7995b4d53083c3ee7824bd765b5eba8b1a1
fortran: fix checking of CHARACTER lengths in array constructors [PR70231]

gcc/fortran/ChangeLog:

PR fortran/70231
* trans-array.cc (trans_array_constructor): In absence of a typespec,
use string length determined by get_array_ctor_strlen() to reasonably
initialize auxiliary variable for bounds-checking.

gcc/testsuite/ChangeLog:

PR fortran/70231
* gfortran.dg/bounds_check_fail_7.f90: New test.
gcc/fortran/trans-array.cc
gcc/testsuite/gfortran.dg/bounds_check_fail_7.f90 [new file with mode: 0644]