aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/primary.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2005-07-14 12:12:17 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2005-07-14 12:12:17 +0200
commitd71b89ca60e6546aaef903c22c6459b592f934d4 (patch)
treec2963bb336cabb4f3f780c2faf9a7041c131dbc1 /gcc/fortran/primary.c
parentcb1119b785be0b910b6c7a9e2ee1f0338badf579 (diff)
downloadgcc-d71b89ca60e6546aaef903c22c6459b592f934d4.zip
gcc-d71b89ca60e6546aaef903c22c6459b592f934d4.tar.gz
gcc-d71b89ca60e6546aaef903c22c6459b592f934d4.tar.bz2
gfortran.h (MAX_ERROR_MESSAGE): Remove.
* gfortran.h (MAX_ERROR_MESSAGE): Remove. (gfc_error_buf): Add allocated and index fields. Change message field from array to a pointer. * error.c (use_warning_buffer, error_ptr, warning_ptr): Remove. (cur_error_buffer): New variable. (error_char): Use cur_error_buffer->{message,index} instead of {warning,error}_{buffer.message,ptr}. Reallocate message buffer if too small. (gfc_warning, gfc_notify_std, gfc_error, gfc_error_now): Setup cur_error_buffer and its index rather than {warning,error}_ptr and use_warning_buffer. (gfc_warning_check, gfc_error_check): Don't print anything if message is NULL. (gfc_push_error): Allocate saved message with xstrdup. (gfc_pop_error): Free saved message with gfc_free. (gfc_free_error): New function. * primary.c (match_complex_constant): Call gfc_free_error if gfc_pop_error will not be called. * match.c (gfc_match_st_function): Likewise. * gfortran.dg/g77/cpp6.f: New test. From-SVN: r102015
Diffstat (limited to 'gcc/fortran/primary.c')
-rw-r--r--gcc/fortran/primary.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/gcc/fortran/primary.c b/gcc/fortran/primary.c
index 36e5eb9..888caff 100644
--- a/gcc/fortran/primary.c
+++ b/gcc/fortran/primary.c
@@ -1117,7 +1117,10 @@ match_complex_constant (gfc_expr ** result)
m = match_complex_part (&real);
if (m == MATCH_NO)
- goto cleanup;
+ {
+ gfc_free_error (&old_error);
+ goto cleanup;
+ }
if (gfc_match_char (',') == MATCH_NO)
{
@@ -1132,7 +1135,10 @@ match_complex_constant (gfc_expr ** result)
sort. These sort of lists are matched prior to coming here. */
if (m == MATCH_ERROR)
- goto cleanup;
+ {
+ gfc_free_error (&old_error);
+ goto cleanup;
+ }
gfc_pop_error (&old_error);
m = match_complex_part (&imag);