OSDN Git Service
(root)
/
android-x86
/
external-llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f87901f
)
Fix signed overflow detected by ubsan
author
Vitaly Buka
<vitalybuka@google.com>
Tue, 17 Oct 2017 18:33:15 +0000
(18:33 +0000)
committer
Vitaly Buka
<vitalybuka@google.com>
Tue, 17 Oct 2017 18:33:15 +0000
(18:33 +0000)
This overflow does not affect algorithm, so just suppress it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316018
91177308
-0d34-0410-b5e6-
96231b3b80d8
lib/Transforms/Utils/SimplifyCFG.cpp
patch
|
blob
|
history
diff --git
a/lib/Transforms/Utils/SimplifyCFG.cpp
b/lib/Transforms/Utils/SimplifyCFG.cpp
index
63bf68e
..
e7388f6
100644
(file)
--- a/
lib/Transforms/Utils/SimplifyCFG.cpp
+++ b/
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