]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
2013-06-11 Martin Jambor <mjambor@suse.cz>
authorjamborm <jamborm@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 11 Jun 2013 12:50:13 +0000 (12:50 +0000)
committerjamborm <jamborm@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 11 Jun 2013 12:50:13 +0000 (12:50 +0000)
* ipa-cp.c (ipa_get_indirect_edge_target_1): Check that param_index is
within bounds at the beginning of the function.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@199953 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/ipa-cp.c

index f346780e5f26b8c1191f4e9f4720b103765f0d45..f02e6b2a6e94ac65833a8a8a52f612379cba8623 100644 (file)
@@ -1,3 +1,8 @@
+2013-06-11  Martin Jambor  <mjambor@suse.cz>
+
+       * ipa-cp.c (ipa_get_indirect_edge_target_1): Check that param_index is
+       within bounds at the beginning of the function.
+
 2013-06-11  Alan Modra  <amodra@gmail.com>
 
        * varasm.c (get_section): Don't die on !DECL_P decl.  Tidy error
index af4e94862d3acefa72a6723f281aa08d83b2033c..9c29d1dbc91c26d3d53e5f5351b5961a2210642c 100644 (file)
@@ -1481,7 +1481,8 @@ ipa_get_indirect_edge_target_1 (struct cgraph_edge *ie,
   tree otr_type;
   tree t;
 
-  if (param_index == -1)
+  if (param_index == -1
+      || known_vals.length () <= (unsigned int) param_index)
     return NULL_TREE;
 
   if (!ie->indirect_info->polymorphic)
@@ -1516,8 +1517,7 @@ ipa_get_indirect_edge_target_1 (struct cgraph_edge *ie,
            t = NULL;
        }
       else
-       t = (known_vals.length () > (unsigned int) param_index
-            ? known_vals[param_index] : NULL);
+       t = known_vals[param_index];
 
       if (t &&
          TREE_CODE (t) == ADDR_EXPR