]> git.ipfire.org Git - thirdparty/gcc.git/commit
coroutines: Make call argument handling more robust [PR95440]
authorIain Sandoe <iain@sandoe.co.uk>
Sat, 13 Jun 2020 09:36:29 +0000 (10:36 +0100)
committerIain Sandoe <iain@sandoe.co.uk>
Sat, 13 Jun 2020 16:29:21 +0000 (17:29 +0100)
commitb88498204521731f46b439b33f936009fedfdf35
tree9086e858fde7445f885e3fa148593709b7f8d689
parent652ec7e8c046b239c42dedd295acf1815ed2b93a
coroutines: Make call argument handling more robust [PR95440]

build_new_method_call is supposed to be able to handle a null
arguments list pointer (when the method has no parms).  There
were a couple of places where uses of the argument list pointer
were not defended against NULL.

gcc/cp/ChangeLog:

PR c++/95440
* call.c (add_candidates): Use vec_safe_length() for
testing the arguments list.
(build_new_method_call_1): Use vec_safe_is_empty() when
checking for an empty args list.

gcc/testsuite/ChangeLog:

PR c++/95440
* g++.dg/coroutines/pr95440.C: New test.

(cherry picked from commit a9eec9625ea7165292958be04899b057804192fb)
gcc/cp/call.c
gcc/testsuite/g++.dg/coroutines/pr95440.C [new file with mode: 0644]