aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/dump-parse-tree.cc
diff options
context:
space:
mode:
authorMikael Morin <mikael@gcc.gnu.org>2023-07-13 21:23:44 +0200
committerMikael Morin <mikael@gcc.gnu.org>2023-07-13 21:23:44 +0200
commit616a101848bfd5b61ffdd87ae9b1153139d916ca (patch)
treeebef5c0bff156606089efc4a7441e2922bf4723a /gcc/fortran/dump-parse-tree.cc
parent032b5da1fc781bd3c23d9caa72fb09439e7f6f3a (diff)
downloadgcc-616a101848bfd5b61ffdd87ae9b1153139d916ca.zip
gcc-616a101848bfd5b61ffdd87ae9b1153139d916ca.tar.gz
gcc-616a101848bfd5b61ffdd87ae9b1153139d916ca.tar.bz2
fortran: Release symbols in reversed order [PR106050]
Release symbols in reversed order wrt the order they were allocated. This fixes an error recovery ICE in the case of a misplaced derived type declaration. Such a declaration creates nested symbols, one for the derived type and one for each type parameter, which should be immediately released as the declaration is rejected. This breaks if the derived type is released first. As the type parameter symbols are in the namespace of the derived type, releasing the derived type releases the type parameters, so one can't access them after that, even to release them. Hence, the type parameters should be released first. PR fortran/106050 gcc/fortran/ChangeLog: * symbol.cc (gfc_restore_last_undo_checkpoint): Release symbols in reverse order. gcc/testsuite/ChangeLog: * gfortran.dg/pdt_33.f90: New test.
Diffstat (limited to 'gcc/fortran/dump-parse-tree.cc')
0 files changed, 0 insertions, 0 deletions