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:
86af655
)
Make WriteConstants() more robust against stray values in ValueEnumerator's ValueList
author
Victor Hernandez
<vhernandez@apple.com>
Tue, 12 Jan 2010 23:37:59 +0000
(23:37 +0000)
committer
Victor Hernandez
<vhernandez@apple.com>
Tue, 12 Jan 2010 23:37:59 +0000
(23:37 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93270
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 26c922a7810cd3a1cf63858f83689678a3fc9249..fd1bade8f15d152eaefa0b553ee7a47ba9a9e46c 100644
(file)
--- a/
lib/Bitcode/Writer/BitcodeWriter.cpp
+++ b/
lib/Bitcode/Writer/BitcodeWriter.cpp
@@
-688,6
+688,11
@@
static void WriteConstants(unsigned FirstVal, unsigned LastVal,
Record.clear();
continue;
}
+
+ // Ignore all values in ValueList except for Constants.
+ if (V && (isa<Instruction>(V) || isa<Argument>(V)))
+ continue;
+
const Constant *C = cast<Constant>(V);
unsigned Code = -1U;
unsigned AbbrevToUse = 0;