]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Replace XALLOCAVEC with XCNEWVEC (PR c/79471).
authorMartin Liska <mliska@suse.cz>
Tue, 14 Feb 2017 08:03:42 +0000 (09:03 +0100)
committerMartin Liska <marxin@gcc.gnu.org>
Tue, 14 Feb 2017 08:03:42 +0000 (08:03 +0000)
2017-02-14  Martin Liska  <mliska@suse.cz>

Backport from mainline
2017-02-13  Martin Liska  <mliska@suse.cz>

PR c/79471
* calls.c (expand_call): Replace XALLOCAVEC with XCNEWVEC.

From-SVN: r245418

gcc/ChangeLog
gcc/calls.c

index 6dbad39c5d4583ffc70cd6c5c45d4401e5a57687..1f02d717b6be3513be4520a93bf5a08eb6fc9f79 100644 (file)
@@ -1,3 +1,11 @@
+2017-02-14  Martin Liska  <mliska@suse.cz>
+
+       Backport from mainline
+       2017-02-13  Martin Liska  <mliska@suse.cz>
+
+       PR c/79471
+       * calls.c (expand_call): Replace XALLOCAVEC with XCNEWVEC.
+
 2017-02-08  Segher Boessenkool  <segher@kernel.crashing.org>
 
        PR translation/79397
index 29b4ed18cec76c9dc849e0168a59271761d3d776..d51d5aea0cc8f4fe5cec61f03b0cd10ada9879e4 100644 (file)
@@ -2705,8 +2705,7 @@ expand_call (tree exp, rtx target, int ignore)
     n_named_args = num_actuals;
 
   /* Make a vector to hold all the information about each arg.  */
-  args = XALLOCAVEC (struct arg_data, num_actuals);
-  memset (args, 0, num_actuals * sizeof (struct arg_data));
+  args = XCNEWVEC (struct arg_data, num_actuals);
 
   /* Build up entries in the ARGS array, compute the size of the
      arguments into ARGS_SIZE, etc.  */
@@ -3719,6 +3718,7 @@ expand_call (tree exp, rtx target, int ignore)
   currently_expanding_call--;
 
   free (stack_usage_map_buf);
+  free (args);
 
   /* Join result with returned bounds so caller may use them if needed.  */
   target = chkp_join_splitted_slot (target, valbnd);