c++, coroutines: Check for malformed functions before splitting.
commit3949b7c0a87475692d1727086bdccb8133c53497
authorIain Sandoe <iain@sandoe.co.uk>
Wed, 14 Aug 2024 12:30:30 +0000 (14 13:30 +0100)
committerIain Sandoe <iain@sandoe.co.uk>
Wed, 21 Aug 2024 08:25:29 +0000 (21 09:25 +0100)
tree53f6ea555fd8056a00f5863590622c32fb39eb61
parentcc8fc9850d1a4b614da104cfecd4c2368ee03c98
c++, coroutines: Check for malformed functions before splitting.

This performs the same basic check that is done by finish_function
to catch cases where the function is so badly malformed that we
do not have a consistent binding level.

gcc/cp/ChangeLog:

* coroutines.cc (split_coroutine_body_from_ramp): Check
that the binding level is as expected before attempting
to outline the function body.

Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
gcc/cp/coroutines.cc