This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Google] Fix type merging of argument packs for LIPO


Passes regression tests. Ok for google/4_8?

Thanks,
Teresa

2013-10-07  Teresa Johnson  <tejohnson@google.com>

        * cp/cp-objcp-common.c (cmp_templ_arg): Fix argument pack
        accesses.

Index: cp/cp-objcp-common.c
===================================================================
--- cp/cp-objcp-common.c        (revision 203253)
+++ cp/cp-objcp-common.c        (working copy)
@@ -307,13 +307,15 @@ cmp_templ_arg (tree ta1, tree ta2)
       int n, i;
       if (!ARGUMENT_PACK_P (ta2))
         return 0;
-      n = TREE_VEC_LENGTH (ta1);
-      if (n != TREE_VEC_LENGTH (ta2))
+      tree pack1 = ARGUMENT_PACK_ARGS (ta1);
+      tree pack2 = ARGUMENT_PACK_ARGS (ta2);
+      n = TREE_VEC_LENGTH (pack1);
+      if (n != TREE_VEC_LENGTH (pack2))
         return 0;
       for (i = 0; i < n ; i++)
         {
-          if (!cmp_templ_arg (TREE_VEC_ELT (ta1, i),
-                              TREE_VEC_ELT (ta2, i)))
+          if (!cmp_templ_arg (TREE_VEC_ELT (pack1, i),
+                              TREE_VEC_ELT (pack2, i)))
             return 0;
         }
       return 1;

-- 
Teresa Johnson | Software Engineer | tejohnson@google.com | 408-460-2413


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]