summaryrefslogtreecommitdiff
path: root/gcc/fortran/expr.c
diff options
context:
space:
mode:
authortkoenig <tkoenig@138bc75d-0d04-0410-961f-82ee72b054a4>2017-10-03 15:50:45 +0000
committertkoenig <tkoenig@138bc75d-0d04-0410-961f-82ee72b054a4>2017-10-03 15:50:45 +0000
commitc3f9cd0c11e2a196bae9afb7fcfc99bd31588273 (patch)
tree3f080f47096a2eb15f5bcdde13d4f21783a0805f /gcc/fortran/expr.c
parent27d6fd48f90095dcad21a0b18c5320088d785080 (diff)
2017-10-03 Thomas Koenig <tkoenig@gcc.gnu.org>
Steven G. Kargl <kargl@gcc.gnu.org> Backport from trunk PR fortran/80118 * expr.c (gfc_get_full_arrayspec_from_expr): If there is no symtree, set array spec to NULL. 2017-10-03 Thomas Koenig <tkoenig@gcc.gnu.org> Steven G. Kargl <kargl@gcc.gnu.org> Backport from trunk PR fortran/80118 * gfortran.dg/zero_sized_7.f90: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-7-branch@253383 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran/expr.c')
-rw-r--r--gcc/fortran/expr.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/fortran/expr.c b/gcc/fortran/expr.c
index 1718e4a55b89..bcf66bb445be 100644
--- a/gcc/fortran/expr.c
+++ b/gcc/fortran/expr.c
@@ -4515,7 +4515,11 @@ gfc_get_full_arrayspec_from_expr (gfc_expr *expr)
if (expr->expr_type == EXPR_VARIABLE
|| expr->expr_type == EXPR_CONSTANT)
{
- as = expr->symtree->n.sym->as;
+ if (expr->symtree)
+ as = expr->symtree->n.sym->as;
+ else
+ as = NULL;
+
for (ref = expr->ref; ref; ref = ref->next)
{
switch (ref->type)