diff options
Diffstat (limited to 'gcc/fortran/expr.c')
-rw-r--r-- | gcc/fortran/expr.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/gcc/fortran/expr.c b/gcc/fortran/expr.c index 00ed9a0..d3f0ddf 100644 --- a/gcc/fortran/expr.c +++ b/gcc/fortran/expr.c @@ -2407,12 +2407,18 @@ gfc_check_assign (gfc_expr *lvalue, gfc_expr *rvalue, int conform) return FAILURE; } - if (rvalue->expr_type == EXPR_NULL) - { - gfc_error ("NULL appears on right-hand side in assignment at %L", - &rvalue->where); - return FAILURE; - } + if (rvalue->expr_type == EXPR_NULL) + { + if (lvalue->symtree->n.sym->attr.pointer + && lvalue->symtree->n.sym->attr.data) + return SUCCESS; + else + { + gfc_error ("NULL appears on right-hand side in assignment at %L", + &rvalue->where); + return FAILURE; + } + } if (sym->attr.cray_pointee && lvalue->ref != NULL |