]> gcc.gnu.org Git - gcc.git/commit
c++: GC problem emitting contract functions
authorJason Merrill <jason@redhat.com>
Mon, 5 Jul 2021 23:52:21 +0000 (19:52 -0400)
committerJason Merrill <jason@redhat.com>
Tue, 6 Jul 2021 14:29:15 +0000 (10:29 -0400)
commitd5c78dacbfa17ea45fe0bb9a0e0929e911b9dcc5
treed64883400604ba33a185a82c4da9399e360f97b2
parent9160ebeefbdaf0447d2b06af7038bf490e110d49
c++: GC problem emitting contract functions

Here, the copied list of contracts was getting garbage collected between
compilation of the .pre and .post functions.  Instead of copying the list,
let's remap the conditions when we are ready to emit them.

gcc/cp/ChangeLog:

* contracts.cc (emit_contract_statement): Just add_stmt.
(emit_contract_attr): Renamed from above.
(emit_contract_conditions, emit_assertion): Adjust.
(remap_and_emit_conditions): New.
(finish_function_contracts): Use it.

gcc/testsuite/ChangeLog:

* g++.dg/contracts/contracts-deduced1.C: Use aggressive GC.
gcc/cp/contracts.cc
gcc/testsuite/g++.dg/contracts/contracts-deduced1.C
This page took 0.062759 seconds and 6 git commands to generate.