[Bug libfortran/103634] Runtime crash with PACK on zero-sized arrays

cvs-commit at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Dec 14 15:57:02 GMT 2021


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103634

--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Harald Anlauf <anlauf@gcc.gnu.org>:

https://gcc.gnu.org/g:1c613165a55b212c59a83796b20a1d555e096504

commit r12-5961-g1c613165a55b212c59a83796b20a1d555e096504
Author: Harald Anlauf <anlauf@gmx.de>
Date:   Mon Dec 13 20:50:19 2021 +0100

    Fortran: PACK intrinsic should not try to read from zero-sized array

    libgfortran/ChangeLog:

            PR libfortran/103634
            * intrinsics/pack_generic.c (pack_internal): Handle case when the
            array argument of PACK has one or more extents of size zero to
            avoid invalid reads.

    gcc/testsuite/ChangeLog:

            PR libfortran/103634
            * gfortran.dg/intrinsic_pack_6.f90: New test.


More information about the Gcc-bugs mailing list