diff options
| author | Victor Hernandez <vhernandez@apple.com> | 2010-01-12 23:37:59 +0000 |
|---|---|---|
| committer | Victor Hernandez <vhernandez@apple.com> | 2010-01-12 23:37:59 +0000 |
| commit | fc4aefb129162a708ebd9a99cc166876613ef8d1 (patch) | |
| tree | d862f81e35f4dda7dc84025701fcd1f7700825a8 | |
| parent | 58a6a8ec62b053ea79c56229514d907032218da4 (diff) | |
| download | bcm5719-llvm-fc4aefb129162a708ebd9a99cc166876613ef8d1.tar.gz bcm5719-llvm-fc4aefb129162a708ebd9a99cc166876613ef8d1.zip | |
Make WriteConstants() more robust against stray values in ValueEnumerator's ValueList
llvm-svn: 93270
| -rw-r--r-- | llvm/lib/Bitcode/Writer/BitcodeWriter.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp index 26c922a7810..fd1bade8f15 100644 --- a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp +++ b/llvm/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; |

