aboutsummaryrefslogtreecommitdiff
path: root/gcc/calls.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/calls.c')
-rw-r--r--gcc/calls.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/gcc/calls.c b/gcc/calls.c
index 63c1bc5..6b22e7a 100644
--- a/gcc/calls.c
+++ b/gcc/calls.c
@@ -1555,7 +1555,10 @@ maybe_warn_nonstring_arg (tree fndecl, tree exp)
if (TREE_NO_WARNING (exp) || !warn_stringop_overflow)
return;
+ /* Avoid clearly invalid calls (more checking done below). */
unsigned nargs = call_expr_nargs (exp);
+ if (!nargs)
+ return;
/* The bound argument to a bounded string function like strncpy. */
tree bound = NULL_TREE;