Commit 97756c0e by Martin Jambor Committed by Martin Jambor

ipa-cp.c (ipa_get_indirect_edge_target_1): Check that param_index is within…

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  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.

From-SVN: r199953
parent 2c7b8bf6
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> 2013-06-11 Alan Modra <amodra@gmail.com>
* varasm.c (get_section): Don't die on !DECL_P decl. Tidy error * varasm.c (get_section): Don't die on !DECL_P decl. Tidy error
......
...@@ -1481,7 +1481,8 @@ ipa_get_indirect_edge_target_1 (struct cgraph_edge *ie, ...@@ -1481,7 +1481,8 @@ ipa_get_indirect_edge_target_1 (struct cgraph_edge *ie,
tree otr_type; tree otr_type;
tree t; tree t;
if (param_index == -1) if (param_index == -1
|| known_vals.length () <= (unsigned int) param_index)
return NULL_TREE; return NULL_TREE;
if (!ie->indirect_info->polymorphic) if (!ie->indirect_info->polymorphic)
...@@ -1516,8 +1517,7 @@ ipa_get_indirect_edge_target_1 (struct cgraph_edge *ie, ...@@ -1516,8 +1517,7 @@ ipa_get_indirect_edge_target_1 (struct cgraph_edge *ie,
t = NULL; t = NULL;
} }
else else
t = (known_vals.length () > (unsigned int) param_index t = known_vals[param_index];
? known_vals[param_index] : NULL);
if (t && if (t &&
TREE_CODE (t) == ADDR_EXPR TREE_CODE (t) == ADDR_EXPR
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment