diff options
author | Steven G. Kargl <kargls@comcast.net> | 2006-02-02 19:11:58 +0000 |
---|---|---|
committer | Steven G. Kargl <kargl@gcc.gnu.org> | 2006-02-02 19:11:58 +0000 |
commit | 43bad4beb5160e2e26186d69e8d57da8a6da0413 (patch) | |
tree | 7f6a1a29aeb5321de575fb75e1b447d73c135f9c /gcc/fortran/match.c | |
parent | 14b9dd558c58bc3b167274dfd01def2294594d11 (diff) | |
download | gcc-43bad4beb5160e2e26186d69e8d57da8a6da0413.tar.gz |
re PR fortran/24958 (ICE on invalid nullify)
2006-02-02 Steven G. Kargl <kargls@comcast>
PR fortran/24958
match.c (gfc_match_nullify): Free the list from head not tail.
PR fortran/25072
* match.c (match_forall_header): Fix internal error caused by bogus
gfc_epxr pointers.
gfortran.dg/nullify_2.f90: New test.
From-SVN: r110517
Diffstat (limited to 'gcc/fortran/match.c')
-rw-r--r-- | gcc/fortran/match.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/gcc/fortran/match.c b/gcc/fortran/match.c index 40355d21aab..f726224a74b 100644 --- a/gcc/fortran/match.c +++ b/gcc/fortran/match.c @@ -1890,7 +1890,7 @@ syntax: gfc_syntax_error (ST_NULLIFY); cleanup: - gfc_free_statements (tail); + gfc_free_statements (new_st.next); return MATCH_ERROR; } @@ -3367,12 +3367,13 @@ static match match_forall_header (gfc_forall_iterator ** phead, gfc_expr ** mask) { gfc_forall_iterator *head, *tail, *new; + gfc_expr *msk; match m; gfc_gobble_whitespace (); head = tail = NULL; - *mask = NULL; + msk = NULL; if (gfc_match_char ('(') != MATCH_YES) return MATCH_NO; @@ -3393,6 +3394,7 @@ match_forall_header (gfc_forall_iterator ** phead, gfc_expr ** mask) m = match_forall_iterator (&new); if (m == MATCH_ERROR) goto cleanup; + if (m == MATCH_YES) { tail->next = new; @@ -3402,7 +3404,7 @@ match_forall_header (gfc_forall_iterator ** phead, gfc_expr ** mask) /* Have to have a mask expression */ - m = gfc_match_expr (mask); + m = gfc_match_expr (&msk); if (m == MATCH_NO) goto syntax; if (m == MATCH_ERROR) @@ -3415,13 +3417,14 @@ match_forall_header (gfc_forall_iterator ** phead, gfc_expr ** mask) goto syntax; *phead = head; + *mask = msk; return MATCH_YES; syntax: gfc_syntax_error (ST_FORALL); cleanup: - gfc_free_expr (*mask); + gfc_free_expr (msk); gfc_free_forall_iterator (head); return MATCH_ERROR; |