]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
coroutines: Fix a typo in rewriting the function.
authorIain Sandoe <iain@sandoe.co.uk>
Wed, 23 Jun 2021 07:13:22 +0000 (08:13 +0100)
committerIain Sandoe <iain@sandoe.co.uk>
Tue, 20 Jul 2021 06:54:01 +0000 (07:54 +0100)
When amending the function re-write code, I made a typo in
the block connections.  This has not shown up in any test
fails (as far as can be seen) but is a regression in debug
info.

Fixed thus.

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

* coroutines.cc
(coro_rewrite_function_body): Connect the replacement
function block to the block nest correctly.

(cherry picked from commit 0d5db79a61af150cba48612c9fbc3267262adb93)

gcc/cp/coroutines.cc

index dbd703a67cc8bb3e2cdc4caebade1a31c56dc77b..d9c308690d87dfaab178e28095db49b989f8f56e 100644 (file)
@@ -4071,8 +4071,8 @@ coro_rewrite_function_body (location_t fn_start, tree fnbody, tree orig,
       BIND_EXPR_BLOCK (first) = replace_blk;
       /* The top block has one child, so far, and we have now got a 
         superblock.  */
-      BLOCK_SUPERCONTEXT (block) = top_block;
-      BLOCK_SUBBLOCKS (top_block) = block;
+      BLOCK_SUPERCONTEXT (replace_blk) = top_block;
+      BLOCK_SUBBLOCKS (top_block) = replace_blk;
     }
 
   /* Wrap the function body in a try {} catch (...) {} block, if exceptions