diff options
| author | christos <christos@NetBSD.org> | 2007-01-27 01:27:29 +0000 |
|---|---|---|
| committer | christos <christos@NetBSD.org> | 2007-01-27 01:27:29 +0000 |
| commit | bb1029ffc1aa8f6fb4b9ec6a2976a3864f4d2255 (patch) | |
| tree | 1768d2c9223dc5c78f383da237ec141e915563ec /gnu | |
| parent | d7cf9c93bb470b184da409bc75e8fb1d47ad367a (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.c | 4 |
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; |
