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