diff options
author | tobi <tobi@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-04-06 18:03:09 +0000 |
---|---|---|
committer | tobi <tobi@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-04-06 18:03:09 +0000 |
commit | 15b2e925fa0738eee7d1c0d7a91c230a15b29c0f (patch) | |
tree | 986ebbac31009f6e0072d6ee2774eb5df6569f49 /gcc/fortran/expr.c | |
parent | cd5a68eee0a4148d2f43f8e259845f16ae3b54ff (diff) | |
download | gcc-15b2e925fa0738eee7d1c0d7a91c230a15b29c0f.tar.gz |
fortran/
* expr.c (gfc_check_assign): Don't allow NULL as rhs in a
non-pointer assignment.
testsuite/
* gfortran.dg/pr15754.f90: Change annotations to dg-error.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@97740 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran/expr.c')
-rw-r--r-- | gcc/fortran/expr.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/gcc/fortran/expr.c b/gcc/fortran/expr.c index f4a4b589b1f..d0c99e335a0 100644 --- a/gcc/fortran/expr.c +++ b/gcc/fortran/expr.c @@ -1789,11 +1789,12 @@ gfc_check_assign (gfc_expr * lvalue, gfc_expr * rvalue, int conform) return FAILURE; } - /* This is a guaranteed segfault and possibly a typo: p = NULL() - instead of p => NULL() */ - if (rvalue->expr_type == EXPR_NULL) - gfc_warning ("NULL appears on right-hand side in assignment at %L", - &rvalue->where); + if (rvalue->expr_type == EXPR_NULL) + { + gfc_error ("NULL appears on right-hand side in assignment at %L", + &rvalue->where); + return FAILURE; + } /* This is possibly a typo: x = f() instead of x => f() */ if (gfc_option.warn_surprising |