[PATCH] Fortran : ICE on invalid code PR95398

Mark Eggleston mark.eggleston@codethink.co.uk
Wed Aug 26 07:45:35 GMT 2020

Please find attach a fix for PR95398.  The original patch was  by Steve 

OK to commit?

[PATCH] Fortran  : ICE on invalid code PR95398

The CLASS_DATA macro is used to shorten the code accessing the derived
components of an expressions type specification.  If the type is not
BT_CLASS the derived pointer is NULL resulting in an ICE.  To avoid
dereferencing a NULL pointer the type should be BT_CLASS.

2020-08-26  Steven G. Kargl  <kargl@gcc.gnu.org>


     PR fortran/95398
     * resolve.c (resolve_select_type): Add check for BT_CLASS
     type before using the CLASS_DATA macro which will have a
     NULL pointer to derive components if it isn't BT_CLASS.

2020-08-26  Mark Eggleston <markeggleston@gcc.gnu.org>


     PR fortran/95398
     * gfortran/pr95398.f90: New test.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Fortran-ICE-on-invalid-code-PR95398.patch
Type: text/x-patch
Size: 3298 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-patches/attachments/20200826/b116b6be/attachment.bin>

More information about the Gcc-patches mailing list