]> git.ipfire.org Git - thirdparty/gcc.git/commit
gimplefe: Error recovery for invalid declarations [PR117749]
authorAndrew Pinski <quic_apinski@quicinc.com>
Fri, 29 Nov 2024 23:29:41 +0000 (15:29 -0800)
committerAndrew Pinski <quic_apinski@quicinc.com>
Sat, 30 Nov 2024 07:11:49 +0000 (23:11 -0800)
commit1701efd5c848f56cf9a469c5bf42dd0bca675e0a
tree7c03048a34b59fd3f8354950acbdd0f0278ca207
parenteb9f1baf2a50f2f1ebe23c5ad62b035d5bcfc14b
gimplefe: Error recovery for invalid declarations [PR117749]

c_parser_declarator can return null if there was an error,
but c_parser_gimple_declaration was not ready for that.
This fixes that oversight so we don't get an ICE after the error.

Bootstrapped and tested on x86_64-linux-gnu.

PR c/117749

gcc/c/ChangeLog:

* gimple-parser.cc (c_parser_gimple_declaration): Check
declarator to be non-null.

gcc/testsuite/ChangeLog:

* gcc.dg/gimplefe-55.c: New test.

Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
gcc/c/gimple-parser.cc
gcc/testsuite/gcc.dg/gimplefe-55.c [new file with mode: 0644]