c++: ICE do to GC leakage [PR 99423]
authorNathan Sidwell <nathan@acm.org>
Wed, 10 Mar 2021 20:07:24 +0000 (12:07 -0800)
committerNathan Sidwell <nathan@acm.org>
Wed, 10 Mar 2021 20:12:00 +0000 (12:12 -0800)
commit1f428775acc391c8ce4fcf79b243043f3333cc99
tree3187ffcc82d5b59410e5a4518115786c38fe88cd
parent44fd4dc0b684e06c6c6d08b3994df23135bf2fbc
c++: ICE do to GC leakage [PR 99423]

My reworking of pending-entity loading introduced a GC problem.  The
post-load processing needs to inhibit GCs (that would otherwise occur
in clone_decl).  That wasn't happening on one code path, leading to
dangling pointers in the active call frames.

PR c++/99423
gcc/cp/
* module.cc (post_load_processing): Assert not gcable.
(laxy_load_pendings): Extend no-gc region around
post_load_processing.
gcc/testsuite/
* g++.dg/modules/pr99423_a.H: New.
* g++.dg/modules/pr99423_b.H: New.
gcc/cp/module.cc
gcc/testsuite/g++.dg/modules/pr99423_a.H [new file with mode: 0644]
gcc/testsuite/g++.dg/modules/pr99423_b.H [new file with mode: 0644]