https://gcc.gnu.org/bugzilla/show_bug.cgi?id=48776
--- Comment #12 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Mikael Morin <mik...@gcc.gnu.org>: https://gcc.gnu.org/g:6930e1f1055c39bea170c25f694f7301989e5d1d commit r14-8305-g6930e1f1055c39bea170c25f694f7301989e5d1d Author: Mikael Morin <mik...@gcc.gnu.org> Date: Fri Jan 19 18:47:36 2024 +0100 fortran: Restore current interface info on error [PR111291] This change is a followup to the fix for PR48776 (namely r14-3572-gd58150452976c4ca65ddc811fac78ef956fa96b0 AKA fortran: Restore interface to its previous state on error [PR48776]), which cleaned up new changes from interfaces upon error. Unfortunately, there is one case in that fix that is mishandled, visible on unexpected_interface.f90 with valgrind or an asan-instrumented gfortran. when an interface statement is found while parsing an interface body (which is invalid), the current interface is replaced by the one from the new statement, and as parsing continues, new procedures are added to the new interface, which has been rejected and freed, instead of the original one. This change restores the current interface pointer to its previous value on each rejected statement. PR fortran/48776 PR fortran/111291 gcc/fortran/ChangeLog: * parse.cc: Restore current interface to its previous value on error.