aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorMatt Kraai <kraai@alumni.carnegiemellon.edu>2001-09-11 17:10:15 +0000
committerMatt Kraai <kraai@gcc.gnu.org>2001-09-11 17:10:15 +0000
commit1de3d8770533641f8e210ffc681824e0da2e7ec7 (patch)
tree5692e3d51156c5517baec5f3be0c02fba991f66c /gcc
parent4262e6231adab0ff8a3da565bf620037ce9b1343 (diff)
downloadgcc-1de3d8770533641f8e210ffc681824e0da2e7ec7.zip
gcc-1de3d8770533641f8e210ffc681824e0da2e7ec7.tar.gz
gcc-1de3d8770533641f8e210ffc681824e0da2e7ec7.tar.bz2
builtins.c (c_strlen): Treat an offset too large for a HOST_WIDE_INT as out of range.
* builtins.c (c_strlen): Treat an offset too large for a HOST_WIDE_INT as out of range. From-SVN: r45550
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/builtins.c4
2 files changed, 8 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 74f3fe3..25bf3ba 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2001-10-11 Matt Kraai <kraai@alumni.carnegiemellon.edu>
+
+ * 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 <jh@suse.cz>
* basic-block.h (EDGE_CRITICAL): Remove; renumber other flags.
diff --git a/gcc/builtins.c b/gcc/builtins.c
index 7cd7e89..025dd2c 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);