diff options
author | Steven G. Kargl <kargl@gcc.gnu.org> | 2015-05-18 22:21:08 +0000 |
---|---|---|
committer | Steven G. Kargl <kargl@gcc.gnu.org> | 2015-05-18 22:21:08 +0000 |
commit | bfeeb14516c9ef05958f47a1bad907c1e6d73f5b (patch) | |
tree | 2c3288212c35e9f12c5eef7eb28f5a94f366f9a4 /gcc/fortran/expr.c | |
parent | fce523bf9b3c564d41a46a23014538a6534c0917 (diff) | |
download | gcc-bfeeb14516c9ef05958f47a1bad907c1e6d73f5b.zip gcc-bfeeb14516c9ef05958f47a1bad907c1e6d73f5b.tar.gz gcc-bfeeb14516c9ef05958f47a1bad907c1e6d73f5b.tar.bz2 |
re PR fortran/66045 (ICE on incorrect code with null)
2015-05-18 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/66045
* expr.c (gfc_check_assign): Check for assignment of NULL() instead
of the (intended) pointer assignment.
2015-05-18 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/66045
* gfortran.dg/null1.f90: New test.
From-SVN: r223322
Diffstat (limited to 'gcc/fortran/expr.c')
-rw-r--r-- | gcc/fortran/expr.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/gcc/fortran/expr.c b/gcc/fortran/expr.c index aa79243..a0c3756 100644 --- a/gcc/fortran/expr.c +++ b/gcc/fortran/expr.c @@ -3128,19 +3128,22 @@ gfc_check_assign (gfc_expr *lvalue, gfc_expr *rvalue, int conform) bad_proc = true; /* (ii) The assignment is in the main program; or */ - if (gfc_current_ns->proc_name->attr.is_main_program) + if (gfc_current_ns->proc_name + && gfc_current_ns->proc_name->attr.is_main_program) bad_proc = true; /* (iii) A module or internal procedure... */ - if ((gfc_current_ns->proc_name->attr.proc == PROC_INTERNAL - || gfc_current_ns->proc_name->attr.proc == PROC_MODULE) + if (gfc_current_ns->proc_name + && (gfc_current_ns->proc_name->attr.proc == PROC_INTERNAL + || gfc_current_ns->proc_name->attr.proc == PROC_MODULE) && gfc_current_ns->parent && (!(gfc_current_ns->parent->proc_name->attr.function || gfc_current_ns->parent->proc_name->attr.subroutine) || gfc_current_ns->parent->proc_name->attr.is_main_program)) { /* ... that is not a function... */ - if (!gfc_current_ns->proc_name->attr.function) + if (gfc_current_ns->proc_name + && !gfc_current_ns->proc_name->attr.function) bad_proc = true; /* ... or is not an entry and has a different name. */ |