Fix signed overflow detected by ubsan

This overflow does not affect algorithm, so just suppress it.

llvm-svn: 316018
This commit is contained in:
Vitaly Buka 2017-10-17 18:33:15 +00:00
parent 654bbb3b05
commit 524c0a639d
1 changed files with 1 additions and 1 deletions

View File

@ -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