tree-optimization/105946 - avoid accessing excess args from uninit diag

uninit diagnostics uses passing via reference and access attributes
but that iterates over function type arguments which can in some
cases appearantly outrun the actual arguments leading to ICEs.
The following simply ignores not present arguments.

2022-06-14  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/105946
	* tree-ssa-uninit.cc (maybe_warn_pass_by_reference):
	Do not look at arguments not specified in the function call.

(cherry picked from commit e07a876c07)
This commit is contained in:
Richard Biener 2022-06-14 11:10:13 +02:00
parent 4ed850a568
commit 92aa949031
1 changed files with 3 additions and 0 deletions

View File

@ -797,6 +797,9 @@ maybe_warn_pass_by_reference (gcall *stmt, wlimits &wlims)
{
++argno;
if (argno > nargs)
break;
if (!POINTER_TYPE_P (argtype))
continue;