diff options
author | Jakub Jelinek <jakub@redhat.com> | 2020-06-30 11:42:54 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2020-06-30 11:42:54 +0200 |
commit | 8dc933c12f489626339b3ba1a8e2dc23eb4de98e (patch) | |
tree | 38dda892d7b271f8ffad39eac675776fce741dc5 /gcc/c-family/c-common.c | |
parent | 458f12eda16ee19354ca1937daef45d79bc7ad46 (diff) | |
download | gcc-8dc933c12f489626339b3ba1a8e2dc23eb4de98e.tar.gz |
c-family: Avoid ICEs on calls to internal functions [PR95963]
The following testcase ICEs since recent Martin's -Wnonnull changes,
we see a CALL_EXPR and ICE because CALL_EXPR_FN is NULL, which is
valid for internal function calls. Internal function calls don't have a
function type, and will never have format_arg attribute on them nor will
serve as the i18n routines -Wformat cares about.
2020-06-30 Jakub Jelinek <jakub@redhat.com>
PR c++/95963
* c-common.c (check_function_arguments_recurse): Don't crash on
calls to internal functions.
* g++.dg/cpp1z/launder9.C: New test.
Diffstat (limited to 'gcc/c-family/c-common.c')
-rw-r--r-- | gcc/c-family/c-common.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c index cfd12c0177f..aae1ddb6b89 100644 --- a/gcc/c-family/c-common.c +++ b/gcc/c-family/c-common.c @@ -5815,7 +5815,7 @@ check_function_arguments_recurse (void (*callback) return; } - if (TREE_CODE (param) == CALL_EXPR) + if (TREE_CODE (param) == CALL_EXPR && CALL_EXPR_FN (param)) { tree type = TREE_TYPE (TREE_TYPE (CALL_EXPR_FN (param))); tree attrs; |