diff options
author | Nick Lewycky <nicholas@mxc.ca> | 2009-07-13 02:49:08 +0000 |
---|---|---|
committer | Nick Lewycky <nicholas@mxc.ca> | 2009-07-13 02:49:08 +0000 |
commit | 73b704dd9c694d3c4641befa20fa00a7fee06065 (patch) | |
tree | 27754ece444dc09bad263c54c74dccf0d661eee0 /llvm/lib/Support/ConstantRange.cpp | |
parent | e7cabb94a3406eb1e7b6a55e89cada922bdee725 (diff) | |
download | bcm5719-llvm-73b704dd9c694d3c4641befa20fa00a7fee06065.tar.gz bcm5719-llvm-73b704dd9c694d3c4641befa20fa00a7fee06065.zip |
Fix a bug summing two full sets. The overflow checking doesn't handle sets as
large as the full set, only those one size smaller. Thanks to Daniel Dunbar
who found this bug using Klee!
llvm-svn: 75443
Diffstat (limited to 'llvm/lib/Support/ConstantRange.cpp')
-rw-r--r-- | llvm/lib/Support/ConstantRange.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/Support/ConstantRange.cpp b/llvm/lib/Support/ConstantRange.cpp index 04a1b68e072..8bab5377952 100644 --- a/llvm/lib/Support/ConstantRange.cpp +++ b/llvm/lib/Support/ConstantRange.cpp @@ -533,6 +533,8 @@ ConstantRange ConstantRange::add(const ConstantRange &Other) const { if (isEmptySet() || Other.isEmptySet()) return ConstantRange(getBitWidth(), /*isFullSet=*/false); + if (isFullSet() || Other.isFullSet()) + return ConstantRange(getBitWidth(), /*isFullSet=*/true); APInt Spread_X = getSetSize(), Spread_Y = Other.getSetSize(); APInt NewLower = getLower() + Other.getLower(); |