diff options
author | Tobias Schlüter <tobias.schlueter@physik.uni-muenchen.de> | 2005-04-06 20:03:09 +0200 |
---|---|---|
committer | Tobias Schlüter <tobi@gcc.gnu.org> | 2005-04-06 20:03:09 +0200 |
commit | ccccdb8d9b339972382604e17d0e451fa590f1a0 (patch) | |
tree | 986ebbac31009f6e0072d6ee2774eb5df6569f49 /gcc/fortran/expr.c | |
parent | e3eff25ac18a36ff69e645befd92b88feae050a8 (diff) | |
download | gcc-ccccdb8d9b339972382604e17d0e451fa590f1a0.zip gcc-ccccdb8d9b339972382604e17d0e451fa590f1a0.tar.gz gcc-ccccdb8d9b339972382604e17d0e451fa590f1a0.tar.bz2 |
expr.c (gfc_check_assign): Don't allow NULL as rhs in a non-pointer assignment.
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.
From-SVN: r97740
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 f4a4b589..d0c99e3 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 |