diff options
author | Jan Hubicka <jh@suse.cz> | 2011-04-24 12:43:00 +0200 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2011-04-24 10:43:00 +0000 |
commit | f3181aa2021d0ac64a0cce8a6c2a926553e7639a (patch) | |
tree | 169486f39c22a6680ce791881b07a86b570a02a4 /gcc/ipa-prop.h | |
parent | 739986ef4a4143b0b358a2fe77cb0a62da78ac7e (diff) | |
download | gcc-f3181aa2021d0ac64a0cce8a6c2a926553e7639a.zip gcc-f3181aa2021d0ac64a0cce8a6c2a926553e7639a.tar.gz gcc-f3181aa2021d0ac64a0cce8a6c2a926553e7639a.tar.bz2 |
ipa-prop.c (ipa_propagate_indirect_call_infos): Remove obsolette WPA hack.
* ipa-prop.c (ipa_propagate_indirect_call_infos): Remove obsolette
WPA hack.
* ipa-prop.h (ipa_get_param, ipa_is_param_used, ipa_param_cannot_devirtualize_p,
ipa_param_types_vec_empty, ipa_get_ith_jump_func, ipa_get_lattice):
Fortify array bounds.
* ipa-inline-analysis.c (add_clause): Fix clause ordering.
(and_predicates, or_predicates, predicates_equal_p, evaulate_predicate):
Sanity check predicate length.
(remap_predicate): Likewise; sanity check jump functions.
(inline_read_section, inline_write_summary): Sanity check
predicate length.
From-SVN: r172914
Diffstat (limited to 'gcc/ipa-prop.h')
-rw-r--r-- | gcc/ipa-prop.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/ipa-prop.h b/gcc/ipa-prop.h index 3ae0d1b..d5f1bc6 100644 --- a/gcc/ipa-prop.h +++ b/gcc/ipa-prop.h @@ -228,6 +228,7 @@ ipa_get_param_count (struct ipa_node_params *info) static inline tree ipa_get_param (struct ipa_node_params *info, int i) { + gcc_assert (i >= 0 && i <= info->param_count); return info->params[i].decl; } @@ -237,6 +238,7 @@ ipa_get_param (struct ipa_node_params *info, int i) static inline bool ipa_is_param_used (struct ipa_node_params *info, int i) { + gcc_assert (i >= 0 && i <= info->param_count); return info->params[i].used; } @@ -247,6 +249,7 @@ ipa_is_param_used (struct ipa_node_params *info, int i) static inline bool ipa_param_cannot_devirtualize_p (struct ipa_node_params *info, int i) { + gcc_assert (i >= 0 && i <= info->param_count); return info->params[i].cannot_devirtualize; } @@ -256,6 +259,7 @@ ipa_param_cannot_devirtualize_p (struct ipa_node_params *info, int i) static inline bool ipa_param_types_vec_empty (struct ipa_node_params *info, int i) { + gcc_assert (i >= 0 && i <= info->param_count); return info->params[i].types == NULL; } @@ -315,6 +319,7 @@ ipa_get_cs_argument_count (struct ipa_edge_args *args) static inline struct ipa_jump_func * ipa_get_ith_jump_func (struct ipa_edge_args *args, int i) { + gcc_assert (i >= 0 && i <= args->argument_count); return &args->jump_functions[i]; } @@ -528,6 +533,7 @@ tree build_ref_for_offset (location_t, tree, HOST_WIDE_INT, tree, static inline struct ipcp_lattice * ipa_get_lattice (struct ipa_node_params *info, int i) { + gcc_assert (i >= 0 && i <= info->param_count); return &(info->params[i].ipcp_lattice); } |