Fix read of uninitialized value in make_pack_expansion()
authorPatrick Palka <ppalka@gcc.gnu.org>
Tue, 22 Dec 2015 17:49:21 +0000 (17:49 +0000)
committerPatrick Palka <ppalka@gcc.gnu.org>
Tue, 22 Dec 2015 17:49:21 +0000 (17:49 +0000)
gcc/cp/ChangeLog:

* pt.c (make_pack_expansion): Make sure to initialize
ppd.type_pack_expansion_p.

From-SVN: r231904

gcc/cp/ChangeLog
gcc/cp/pt.c

index bba3973..1d4714a 100644 (file)
@@ -1,3 +1,8 @@
+2015-12-22  Patrick Palka  <ppalka@gcc.gnu.org>
+
+       * pt.c (make_pack_expansion): Make sure to initialize
+       ppd.type_pack_expansion_p.
+
 2015-12-21  David Malcolm  <dmalcolm@redhat.com>
 
        * typeck.c (cp_build_binary_op): Update for change in signature
index 209e65f..dab15bd 100644 (file)
@@ -3637,6 +3637,8 @@ make_pack_expansion (tree arg)
          class expansion.  */
       ppd.visited = new hash_set<tree>;
       ppd.parameter_packs = &parameter_packs;
+      ppd.type_pack_expansion_p = true;
+      gcc_assert (TYPE_P (TREE_PURPOSE (arg)));
       cp_walk_tree (&TREE_PURPOSE (arg), &find_parameter_packs_r, 
                     &ppd, ppd.visited);