diff options
Diffstat (limited to 'gcc/tree-ssa-structalias.c')
-rw-r--r-- | gcc/tree-ssa-structalias.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c index 5e197c4..70a9d32 100644 --- a/gcc/tree-ssa-structalias.c +++ b/gcc/tree-ssa-structalias.c @@ -4062,7 +4062,13 @@ push_fields_onto_fieldstack (tree type, VEC(fieldoff_s,heap) **fieldstack, { tree field; int count = 0; - int first_element = VEC_length (fieldoff_s, *fieldstack); + unsigned int first_element = VEC_length (fieldoff_s, *fieldstack); + + /* If the vector of fields is growing too big, bail out early. + Callers check for VEC_length <= MAX_FIELDS_FOR_FIELD_SENSITIVE, make + sure this fails. */ + if (first_element > MAX_FIELDS_FOR_FIELD_SENSITIVE) + return 0; if (TREE_CODE (type) == COMPLEX_TYPE) { |