]> code.ossystems Code Review - openembedded-core.git/blob
4111e339693bfb36a408986702cbf11c43f2c51a
[openembedded-core.git] /
1 Upstream-Status: Inappropriate [Backport]
2 From 8216e1c4c23928723f8e1583bf7e014813bb2c07 Mon Sep 17 00:00:00 2001
3 From: baldrick <baldrick@138bc75d-0d04-0410-961f-82ee72b054a4>
4 Date: Sat, 9 Apr 2011 16:14:07 +0000
5 Subject: [PATCH 094/200] Bail out rather than crashing in array_type_nelts if TYPE_MAX_VALUE is null.
6
7 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_6-branch@172226 138bc75d-0d04-0410-961f-82ee72b054a4
8
9 index 405b549..4d6ca36 100644
10 --- a/gcc/tree.c
11 +++ b/gcc/tree.c
12 @@ -2453,6 +2453,10 @@ array_type_nelts (const_tree type)
13    min = TYPE_MIN_VALUE (index_type);
14    max = TYPE_MAX_VALUE (index_type);
15  
16 +  /* TYPE_MAX_VALUE may not be set if the array has unknown length.  */
17 +  if (!max)
18 +    return error_mark_node;
19 +
20    return (integer_zerop (min)
21           ? max
22           : fold_build2 (MINUS_EXPR, TREE_TYPE (max), max, min));
23 -- 
24 1.7.0.4
25