summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Utils/SimplifyCFG.cpp
diff options
context:
space:
mode:
authorVitaly Buka <vitalybuka@google.com>2017-10-17 18:33:15 +0000
committerVitaly Buka <vitalybuka@google.com>2017-10-17 18:33:15 +0000
commit524c0a639dd86ffd97b96e5b71f04fa038c69792 (patch)
tree0f2abe77fadf60cccc591ed0dd076b2af22229fc /llvm/lib/Transforms/Utils/SimplifyCFG.cpp
parent654bbb3b0526f61882f212247864b1572ac339cd (diff)
downloadbcm5719-llvm-524c0a639dd86ffd97b96e5b71f04fa038c69792.tar.gz
bcm5719-llvm-524c0a639dd86ffd97b96e5b71f04fa038c69792.zip
Fix signed overflow detected by ubsan
This overflow does not affect algorithm, so just suppress it. llvm-svn: 316018
Diffstat (limited to 'llvm/lib/Transforms/Utils/SimplifyCFG.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/SimplifyCFG.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp
index 63bf68e4cee..e7388f63864 100644
--- a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp
+++ b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp
@@ -5439,7 +5439,7 @@ static bool ReduceSwitchRange(SwitchInst *SI, IRBuilder<> &Builder,
// First, transform the values such that they start at zero and ascend.
int64_t Base = Values[0];
for (auto &V : Values)
- V -= Base;
+ V -= (uint64_t)(Base);
// Now we have signed numbers that have been shifted so that, given enough
// precision, there are no negative values. Since the rest of the transform
OpenPOWER on IntegriCloud