aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndre Vehreschild <vehre@gcc.gnu.org>2024-08-13 15:06:56 +0200
committerAndre Vehreschild <vehre@gcc.gnu.org>2024-08-14 09:20:24 +0200
commit54be14bfd6e2dee7cb4e1b3c20dc2677093ee818 (patch)
tree330c3fa5a6a814d1a1d27964bb6b7f5e3fdccf0c
parentbb2324769c5a03e275de00416659e624c97f1442 (diff)
downloadgcc-54be14bfd6e2dee7cb4e1b3c20dc2677093ee818.zip
gcc-54be14bfd6e2dee7cb4e1b3c20dc2677093ee818.tar.gz
gcc-54be14bfd6e2dee7cb4e1b3c20dc2677093ee818.tar.bz2
Prevent future proc_ptr parsing issues in associate [PR102973]
A global variable is set when proc_ptr parsing in an associate is expected. In the case of an error, that flag was not reset, which is fixed now. gcc/fortran/ChangeLog: PR fortran/102973 * match.cc (gfc_match_associate): Reset proc_ptr parsing flag on error.
-rw-r--r--gcc/fortran/match.cc1
1 files changed, 1 insertions, 0 deletions
diff --git a/gcc/fortran/match.cc b/gcc/fortran/match.cc
index 1851a8f..e4b60bf 100644
--- a/gcc/fortran/match.cc
+++ b/gcc/fortran/match.cc
@@ -1932,6 +1932,7 @@ gfc_match_associate (void)
gfc_matching_procptr_assignment = 1;
if (gfc_match (" %e", &newAssoc->target) != MATCH_YES)
{
+ gfc_matching_procptr_assignment = 0;
gfc_error ("Invalid association target at %C");
goto assocListError;
}