[PATCH] PR fortran/70070 - ICE on initializing character data beyond min/max bound
Harald Anlauf
anlauf@gmx.de
Sun Jan 24 21:12:00 GMT 2021
Dear all,
the attached patch is pretty much self-explaining: check for bounds violation
when initializing a substring in a data statement and treat the resulting error.
If more detailed information should be emitted with the error message, I'm
open for suggestions.
Regtested on x86_64-pc-linux-gnu.
OK for master?
Thanks,
Harald
PR fortran/70070 - ICE on initializing character data beyond min/max bound
Check for initialization of substrings beyond bounds in DATA statements.
gcc/fortran/ChangeLog:
PR fortran/70070
* data.c (create_character_initializer): Check substring indices
against bounds.
(gfc_assign_data_value): Catch error returned from
create_character_initializer.
gcc/testsuite/ChangeLog:
PR fortran/70070
* gfortran.dg/pr70070.f90: New test.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr70070.patch
Type: text/x-patch
Size: 1332 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-patches/attachments/20210124/72194354/attachment.bin>
More information about the Gcc-patches
mailing list