From: kraai Date: Tue, 11 Sep 2001 17:10:15 +0000 (+0000) Subject: * builtins.c (c_strlen): Treat an offset too large for a X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=dabc40842c44313856b834fbe33dcca519c47a52;p=thirdparty%2Fgcc.git * 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 74f3fe36b594..25bf3ba5d569 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2001-10-11 Matt Kraai + + * builtins.c (c_strlen): Treat an offset too large for a + HOST_WIDE_INT as out of range. + Tue Sep 11 18:57:47 CEST 2001 Jan Hubicka * basic-block.h (EDGE_CRITICAL): Remove; renumber other flags. diff --git a/gcc/builtins.c b/gcc/builtins.c index 7cd7e899113d..025dd2c5902e 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);