+2020-01-23 David Malcolm <dmalcolm@redhat.com>
+
+ PR analyzer/93375
+ * supergraph.cc (callgraph_superedge::get_arg_for_parm): Fail
+ gracefully is the number of parameters at the callee exceeds the
+ number of arguments at the call stmt.
+ (callgraph_superedge::get_parm_for_arg): Likewise.
+
2020-01-22 David Malcolm <dmalcolm@redhat.com>
PR analyzer/93382
gcc_assert (TREE_CODE (parm_to_find) == PARM_DECL);
tree callee = get_callee_decl ();
+ const gcall *call_stmt = get_call_stmt ();
- int i = 0;
+ unsigned i = 0;
for (tree iter_parm = DECL_ARGUMENTS (callee); iter_parm;
iter_parm = DECL_CHAIN (iter_parm), ++i)
{
+ if (i >= gimple_call_num_args (call_stmt))
+ return NULL_TREE;
if (iter_parm == parm_to_find)
{
if (out)
*out = callsite_expr::from_zero_based_param (i);
- return gimple_call_arg (get_call_stmt (), i);
+ return gimple_call_arg (call_stmt, i);
}
}
callsite_expr *out) const
{
tree callee = get_callee_decl ();
+ const gcall *call_stmt = get_call_stmt ();
- int i = 0;
+ unsigned i = 0;
for (tree iter_parm = DECL_ARGUMENTS (callee); iter_parm;
iter_parm = DECL_CHAIN (iter_parm), ++i)
{
- tree param = gimple_call_arg (get_call_stmt (), i);
+ if (i >= gimple_call_num_args (call_stmt))
+ return NULL_TREE;
+ tree param = gimple_call_arg (call_stmt, i);
if (arg_to_find == param)
{
if (out)
+2020-01-23 David Malcolm <dmalcolm@redhat.com>
+
+ PR analyzer/93375
+ * gcc.dg/analyzer/pr93375.c: New test.
+
2020-01-23 Jason Merrill <jason@redhat.com>
* lib/target-supports.exp (check_effective_target_unsigned_char):