]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Prevent future proc_ptr parsing issues in associate [PR102973]
authorAndre Vehreschild <vehre@gcc.gnu.org>
Tue, 13 Aug 2024 13:06:56 +0000 (15:06 +0200)
committerAndre Vehreschild <vehre@gcc.gnu.org>
Wed, 14 Aug 2024 07:20:24 +0000 (09:20 +0200)
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.

gcc/fortran/match.cc

index 1851a8f94a5426abf5bae34ae4cfd4968f7b7fb2..e4b60bf5f685747f3072e93d80cfb62f8d417673 100644 (file)
@@ -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;
            }