]> git.ipfire.org Git - thirdparty/gcc.git/commit
coroutines, testsuite: Fix co-ret-17-void-ret-coro.C.
authorIain Sandoe <iain@sandoe.co.uk>
Tue, 26 May 2020 07:57:32 +0000 (08:57 +0100)
committerIain Sandoe <iain@sandoe.co.uk>
Tue, 26 May 2020 11:27:48 +0000 (12:27 +0100)
commitf6615c213354fd3ec7fc6238e61cc26bb1830464
treeda7fa87ac3cace0696ca8bad889960f7ccd42abd
parentc8462662da25f2cb8de0e4fe82ec5880041f38f2
coroutines, testsuite: Fix co-ret-17-void-ret-coro.C.

This was a bad testcase, found with fsanitize=address; the final suspend
is 'suspend never' which flows off the end of the coroutine destroying
the promise and the frame.   At that point access via the handle is an
error.  Fixed by checking that the promise is destroyed via a global var.

gcc/testsuite/ChangeLog:

* g++.dg/coroutines/torture/co-ret-17-void-ret-coro.C: Check for
promise destruction via a global variable.
gcc/testsuite/g++.dg/coroutines/torture/co-ret-17-void-ret-coro.C