aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/check.c
diff options
context:
space:
mode:
authorSteven G. Kargl <kargl@gcc.gnu.org>2015-05-18 21:52:03 +0000
committerSteven G. Kargl <kargl@gcc.gnu.org>2015-05-18 21:52:03 +0000
commitce7fb7118f9b9215a7a0320071fb0e956fec2dd6 (patch)
treea5bad65a6692df1c301fc7f2c2576e82c753bb26 /gcc/fortran/check.c
parent46b6b3542d8c47e285e4e606f889411e4739a886 (diff)
downloadgcc-ce7fb7118f9b9215a7a0320071fb0e956fec2dd6.zip
gcc-ce7fb7118f9b9215a7a0320071fb0e956fec2dd6.tar.gz
gcc-ce7fb7118f9b9215a7a0320071fb0e956fec2dd6.tar.bz2
re PR fortran/66043 (ICE on storage_size of null or output of null array)
2015-05-18 Steven G. Kargl <kargl@gcc.gnu.org> PR fortran/66043 * check.c (gfc_check_storage_size): Prevent the direct use of NULL() in STORAGE_SIZE() reference. 2015-05-18 Steven G. Kargl <kargl@gcc.gnu.org> PR fortran/66043 * gfortran.dg/storage_size_6.f90: New tests. From-SVN: r223320
Diffstat (limited to 'gcc/fortran/check.c')
-rw-r--r--gcc/fortran/check.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc/fortran/check.c b/gcc/fortran/check.c
index 3e0ce5c..a6ba549 100644
--- a/gcc/fortran/check.c
+++ b/gcc/fortran/check.c
@@ -6243,6 +6243,15 @@ gfc_check_and (gfc_expr *i, gfc_expr *j)
bool
gfc_check_storage_size (gfc_expr *a, gfc_expr *kind)
{
+
+ if (a->expr_type == EXPR_NULL)
+ {
+ gfc_error ("Intrinsic function NULL at %L cannot be an actual "
+ "argument to STORAGE_SIZE, because it returns a "
+ "disassociated pointer", &a->where);
+ return false;
+ }
+
if (a->ts.type == BT_ASSUMED)
{
gfc_error ("%qs argument of %qs intrinsic at %L shall not be TYPE(*)",