From: Nathan Sidwell Date: Wed, 13 Jan 2021 13:13:12 +0000 (-0800) Subject: c++: Fix cp_build_function_call_vec [PR 98626] X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=11cbea852b0ae2b0f17a9caeaf6344d689231c2f;p=gcc.git c++: Fix cp_build_function_call_vec [PR 98626] I misunderstood the cp_build_function_call_vec API, thinking a NULL vector was an acceptable way of passing no arguments. You need to pass a vector of no elements. PR c++/98626 gcc/cp/ * module.cc (module_add_import_initializers): Pass a zero-element argument vector. --- diff --git a/gcc/cp/module.cc b/gcc/cp/module.cc index d2093916c9e..1fd0bcfe3eb 100644 --- a/gcc/cp/module.cc +++ b/gcc/cp/module.cc @@ -18977,8 +18977,8 @@ module_add_import_initializers () if (modules) { tree fntype = build_function_type (void_type_node, void_list_node); - vec *args = NULL; - + releasing_vec args; // There are no args + for (unsigned ix = modules->length (); --ix;) { module_state *import = (*modules)[ix];