summaryrefslogtreecommitdiff
path: root/gcc/cfgexpand.c
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2005-07-11 07:31:08 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2005-07-11 07:31:08 +0000
commitb888d9d53dd0e1c17e63ee61a53a52fd567feae0 (patch)
treeaa4aa509495eee4f3892001802de1ed8b407abf3 /gcc/cfgexpand.c
parentc72c75a7ed419cd07fed21fefaf9f9089ffb286b (diff)
downloadgcc-b888d9d53dd0e1c17e63ee61a53a52fd567feae0.tar.gz
* cfgexpand.c (stack_protect_classify_type): Use TYPE_SIZE_UNIT (type)
instead of TYPE_MAX_VALUE (TYPE_DOMAIN (type)) to get array size in bytes. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@101864 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cfgexpand.c')
-rw-r--r--gcc/cfgexpand.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c
index 87b82459c27..83a88cc15d2 100644
--- a/gcc/cfgexpand.c
+++ b/gcc/cfgexpand.c
@@ -770,15 +770,14 @@ stack_protect_classify_type (tree type)
|| t == signed_char_type_node
|| t == unsigned_char_type_node)
{
- HOST_WIDE_INT max = PARAM_VALUE (PARAM_SSP_BUFFER_SIZE);
- HOST_WIDE_INT len;
+ unsigned HOST_WIDE_INT max = PARAM_VALUE (PARAM_SSP_BUFFER_SIZE);
+ unsigned HOST_WIDE_INT len;
- if (!TYPE_DOMAIN (type)
- || !TYPE_MAX_VALUE (TYPE_DOMAIN (type))
- || !host_integerp (TYPE_MAX_VALUE (TYPE_DOMAIN (type)), 1))
- len = max + 1;
+ if (!TYPE_SIZE_UNIT (type)
+ || !host_integerp (TYPE_SIZE_UNIT (type), 1))
+ len = max;
else
- len = tree_low_cst (TYPE_MAX_VALUE (TYPE_DOMAIN (type)), 1);
+ len = tree_low_cst (TYPE_SIZE_UNIT (type), 1);
if (len < max)
ret = SPCT_HAS_SMALL_CHAR_ARRAY | SPCT_HAS_ARRAY;