https://gcc.gnu.org/g:54be14bfd6e2dee7cb4e1b3c20dc2677093ee818

commit r15-2911-g54be14bfd6e2dee7cb4e1b3c20dc2677093ee818
Author: Andre Vehreschild <ve...@gcc.gnu.org>
Date:   Tue Aug 13 15:06:56 2024 +0200

    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.

Diff:
---
 gcc/fortran/match.cc | 1 +
 1 file changed, 1 insertion(+)

diff --git a/gcc/fortran/match.cc b/gcc/fortran/match.cc
index 1851a8f94a54..e4b60bf5f685 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;
            }

Reply via email to