+2012-01-08 Jan Hubicka <jh@suse.cz>
+
+ PR tree-optimize/51694
+ * ipa-cp.c (ipa_get_indirect_edge_target): Add bounds checks.
+
2012-01-08 Jonathan Wakely <jwakely.gcc@gmail.com>
* doc/cpp.texi (Predefined Macros): __STRICT_ANSI__ is defined
if (!ie->indirect_info->polymorphic)
{
- tree t = VEC_index (tree, known_vals, param_index);
+ tree t = (VEC_length (tree, known_vals) > param_index
+ ? VEC_index (tree, known_vals, param_index) : NULL);
if (t &&
TREE_CODE (t) == ADDR_EXPR
&& TREE_CODE (TREE_OPERAND (t, 0)) == FUNCTION_DECL)
otr_type = ie->indirect_info->otr_type;
t = VEC_index (tree, known_vals, param_index);
- if (!t && known_binfos)
+ if (!t && known_binfos && VEC_length (tree, known_binfos) > param_index)
t = VEC_index (tree, known_binfos, param_index);
if (!t)
return NULL_TREE;
2012-01-07 Jan Hubicka <jh@suse.cz>
+ PR tree-optimize/51694
+ * gcc.c-torture/compile/pr51694.c: new testcase.
+
+2012-01-07 Jan Hubicka <jh@suse.cz>
+
PR tree-optimization/51600
* g++.dg/torture/pr51600.C: New testcase.