diff options
author | Simon Martin <simon@nasilyan.com> | 2024-11-05 10:44:34 +0100 |
---|---|---|
committer | Simon Martin <simon@nasilyan.com> | 2024-11-05 10:44:34 +0100 |
commit | f31b72b75ef7cde61469c774162db7b1cc4c3d03 (patch) | |
tree | d765bfddc1bab768dfe0a144c0faa2d4206090f9 /gcc/go/gofrontend/gogo-tree.cc | |
parent | 5821f5c8c89a054e34cea00e042996dfdcd7e102 (diff) | |
download | gcc-master.zip gcc-master.tar.gz gcc-master.tar.bz2 |
PR117099 and PR117129 are ICEs upon invalid code that happen when NRVO
is activated, and both due to the fact that we don't consistently set
current_function_return_value to error_mark_node upon error in
finish_return_expr.
This patch fixes this inconsistency which fixes both cases since we skip
calling finalize_nrv when current_function_return_value is
error_mark_node.
PR c++/117099
PR c++/117129
gcc/cp/ChangeLog:
* typeck.cc (check_return_expr): Upon error, set
current_function_return_value to error_mark_node.
gcc/testsuite/ChangeLog:
* g++.dg/parse/crash78.C: New test.
* g++.dg/parse/crash78a.C: New test.
* g++.dg/parse/crash79.C: New test.
Diffstat (limited to 'gcc/go/gofrontend/gogo-tree.cc')
0 files changed, 0 insertions, 0 deletions