[llvm-commits] [llvm] r93270 - /llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp
Victor Hernandez
vhernandez at apple.com
Tue Jan 12 15:37:59 PST 2010
Author: hernande
Date: Tue Jan 12 17:37:59 2010
New Revision: 93270
URL: http://llvm.org/viewvc/llvm-project?rev=93270&view=rev
Log:
Make WriteConstants() more robust against stray values in ValueEnumerator's ValueList
Modified:
llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp
Modified: llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp?rev=93270&r1=93269&r2=93270&view=diff
==============================================================================
--- llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp (original)
+++ llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp Tue Jan 12 17:37:59 2010
@@ -688,6 +688,11 @@
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;
More information about the llvm-commits
mailing list