aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorAndrew Macleod <amacleod@gcc.gnu.org>2019-05-03 21:01:48 +0000
committerAndrew Macleod <amacleod@gcc.gnu.org>2019-05-03 21:01:48 +0000
commit2ac65a99b198f89bed3c7fe73bb4d63cc9405919 (patch)
tree197ca103dfd7a03fbef2366195df468fcca219cd /gcc
parent49c8b1a04f4cdbd42631c236678f5651301f845f (diff)
downloadgcc-2ac65a99b198f89bed3c7fe73bb4d63cc9405919.zip
gcc-2ac65a99b198f89bed3c7fe73bb4d63cc9405919.tar.gz
gcc-2ac65a99b198f89bed3c7fe73bb4d63cc9405919.tar.bz2
CHeck that the range returned is not empty before accessing the end points.
From-SVN: r270861
Diffstat (limited to 'gcc')
-rw-r--r--gcc/gimple-ssa-sprintf.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/gimple-ssa-sprintf.c b/gcc/gimple-ssa-sprintf.c
index e566c31..776b245 100644
--- a/gcc/gimple-ssa-sprintf.c
+++ b/gcc/gimple-ssa-sprintf.c
@@ -1373,7 +1373,8 @@ format_integer (const directive &dir, tree arg)
/* Try to determine the range of values of the integer argument
(range information is not available for pointers). */
irange r;
- if (on_demand_get_range_on_stmt (r, arg, dir.callstmt))
+ if (on_demand_get_range_on_stmt (r, arg, dir.callstmt) &&
+ !r.undefined_p ())
{
argmin = wide_int_to_tree (TREE_TYPE (arg), r.lower_bound ());
argmax = wide_int_to_tree (TREE_TYPE (arg), r.upper_bound ());