summaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authorchristos <christos@NetBSD.org>2007-01-27 01:27:29 +0000
committerchristos <christos@NetBSD.org>2007-01-27 01:27:29 +0000
commitbb1029ffc1aa8f6fb4b9ec6a2976a3864f4d2255 (patch)
tree1768d2c9223dc5c78f383da237ec141e915563ec /gnu
parentd7cf9c93bb470b184da409bc75e8fb1d47ad367a (diff)
Don't mark 0 length arrays as being too small for stack protection.
Diffstat (limited to 'gnu')
-rw-r--r--gnu/dist/gcc4/gcc/cfgexpand.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gnu/dist/gcc4/gcc/cfgexpand.c b/gnu/dist/gcc4/gcc/cfgexpand.c
index 711906a239d..6fde1e36046 100644
--- a/gnu/dist/gcc4/gcc/cfgexpand.c
+++ b/gnu/dist/gcc4/gcc/cfgexpand.c
@@ -824,7 +824,9 @@ stack_protect_classify_type (tree type)
else
len = tree_low_cst (TYPE_SIZE_UNIT (type), 1);
- if (len < max)
+ if (len == 0)
+ ret = SPCT_HAS_ARRAY;
+ else if (len < max)
ret = SPCT_HAS_SMALL_CHAR_ARRAY | SPCT_HAS_ARRAY;
else
ret = SPCT_HAS_LARGE_CHAR_ARRAY | SPCT_HAS_ARRAY;