summaryrefslogtreecommitdiff
path: root/gcc/builtins.c
diff options
context:
space:
mode:
authorkraai <kraai@138bc75d-0d04-0410-961f-82ee72b054a4>2001-09-11 17:10:15 +0000
committerkraai <kraai@138bc75d-0d04-0410-961f-82ee72b054a4>2001-09-11 17:10:15 +0000
commitdabc40842c44313856b834fbe33dcca519c47a52 (patch)
tree5692e3d51156c5517baec5f3be0c02fba991f66c /gcc/builtins.c
parente76f35e8d4be0b7032d74033a0ebedc704134961 (diff)
downloadgcc-dabc40842c44313856b834fbe33dcca519c47a52.tar.gz
* builtins.c (c_strlen): Treat an offset too large for a
HOST_WIDE_INT as out of range. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@45550 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/builtins.c')
-rw-r--r--gcc/builtins.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/builtins.c b/gcc/builtins.c
index 7cd7e899113..025dd2c5902 100644
--- a/gcc/builtins.c
+++ b/gcc/builtins.c
@@ -265,8 +265,10 @@ c_strlen (src)
/* We have a known offset into the string. Start searching there for
a null character if we can represent it as a single HOST_WIDE_INT. */
- if (offset_node == 0 || ! host_integerp (offset_node, 0))
+ if (offset_node == 0)
offset = 0;
+ else if (! host_integerp (offset_node, 0))
+ offset = -1;
else
offset = tree_low_cst (offset_node, 0);