]> git.ipfire.org Git - thirdparty/gcc.git/commit
coroutines: Fix ICE with an invalid await_suspend type [PR100673].
authorJohn Eivind Helset <jehelset@gmail.com>
Fri, 21 May 2021 23:53:22 +0000 (01:53 +0200)
committerIain Sandoe <iain@sandoe.co.uk>
Sun, 3 Oct 2021 19:50:23 +0000 (20:50 +0100)
commit8009c79b64b532d8a0966fe3c6d636369df6e35d
tree6167462ba683ccf452a93a9033b797a6d3822c90
parent1b54a7226368bf86361e5c9d8ae523193037a0ac
coroutines: Fix ICE with an invalid await_suspend type [PR100673].

The reported ICE occurs when an invalid (non-template) type is found
as the return for an await_suspend.

Fixed by amending build_co_await to ensure that await_suspend return-
type is a template-instantiation before checking to see if it is a
valid coroutine handle type.

Signed-off-by: John Eivind Helset <jehelset@gmail.com>
Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
PR c++/100673

gcc/cp/ChangeLog:

* coroutines.cc (build_co_await): Guard against NULL
await_suspend types.

gcc/testsuite/ChangeLog:

* g++.dg/coroutines/pr100673.C: New test.
gcc/cp/coroutines.cc
gcc/testsuite/g++.dg/coroutines/pr100673.C [new file with mode: 0644]