]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
coroutines : Add a missed begin/finish else clause to the codegen.
authorIain Sandoe <iain@sandoe.co.uk>
Wed, 3 Mar 2021 16:14:24 +0000 (16:14 +0000)
committerIain Sandoe <iain@sandoe.co.uk>
Sun, 3 Oct 2021 19:19:42 +0000 (20:19 +0100)
Minor code-gen correction.

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

* coroutines.cc (build_actor_fn): Add begin/finish clauses
to the initial test in the actor function.

(cherry picked from commit 21b4d0ef543d68187d258415b51d0d6676af89fd)

gcc/cp/coroutines.cc

index 3fe44e47a3d119e54da928b2c750066548ca16e0..8577320d09b4cfb9f0679f8e04cfd3a239e4a359 100644 (file)
@@ -2332,6 +2332,7 @@ build_actor_fn (location_t loc, tree coro_frame_type, tree actor, tree fnbody,
   finish_switch_stmt (destroy_dispatcher);
 
   finish_then_clause (lsb_if);
+  begin_else_clause (lsb_if);
 
   tree dispatcher = begin_switch_stmt ();
   finish_switch_cond (rat, dispatcher);
@@ -2369,6 +2370,7 @@ build_actor_fn (location_t loc, tree coro_frame_type, tree actor, tree fnbody,
 
   /* Insert the prototype dispatcher.  */
   finish_switch_stmt (dispatcher);
+  finish_else_clause (lsb_if);
 
   finish_if_stmt (lsb_if);