projects
/
oota-llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
84b8ad3
)
avoid undefined behavior negating minint.
author
Chris Lattner
<sabre@nondot.org>
Tue, 3 Aug 2010 16:57:03 +0000
(16:57 +0000)
committer
Chris Lattner
<sabre@nondot.org>
Tue, 3 Aug 2010 16:57:03 +0000
(16:57 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110117
91177308
-0d34-0410-b5e6-
96231b3b80d8
lib/Bitcode/Writer/BitcodeWriter.cpp
patch
|
blob
|
history
diff --git
a/lib/Bitcode/Writer/BitcodeWriter.cpp
b/lib/Bitcode/Writer/BitcodeWriter.cpp
index 93ca8cdaacd149a8097edbd8eb19450a089e8b6c..776c2d4495c167110fb6a8bbd71410bdc3e875d2 100644
(file)
--- a/
lib/Bitcode/Writer/BitcodeWriter.cpp
+++ b/
lib/Bitcode/Writer/BitcodeWriter.cpp
@@
-735,8
+735,8
@@
static void WriteConstants(unsigned FirstVal, unsigned LastVal,
Code = bitc::CST_CODE_UNDEF;
} else if (const ConstantInt *IV = dyn_cast<ConstantInt>(C)) {
if (IV->getBitWidth() <= 64) {
- int64_t V = IV->getSExtValue();
- if (V >= 0)
+
u
int64_t V = IV->getSExtValue();
+ if (
(int64_t)
V >= 0)
Record.push_back(V << 1);
else
Record.push_back((-V << 1) | 1);