Author: kremenek Date: Mon Nov 5 12:13:03 2007 New Revision: 43721 URL: http://llvm.org/viewvc/llvm-project?rev=43721&view=rev Log: Fixed bug where tombstone key and empty key for DenseMap used for pointer backpatching in deserializer were improperly created and resulted in an assertion failure.
Modified: llvm/trunk/include/llvm/Bitcode/Deserialize.h llvm/trunk/include/llvm/Bitcode/Serialize.h Modified: llvm/trunk/include/llvm/Bitcode/Deserialize.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Bitcode/Deserialize.h?rev=43721&r1=43720&r2=43721&view=diff ============================================================================== --- llvm/trunk/include/llvm/Bitcode/Deserialize.h (original) +++ llvm/trunk/include/llvm/Bitcode/Deserialize.h Mon Nov 5 12:13:03 2007 @@ -56,13 +56,14 @@ public: BPKey(unsigned PtrId) : Raw(PtrId << 1) { assert (PtrId > 0); } + BPKey(unsigned code, unsigned) : Raw(code) {} void MarkFinal() { Raw |= 0x1; } bool hasFinalPtr() const { return Raw & 0x1 ? true : false; } unsigned getID() const { return Raw >> 1; } - static inline BPKey getEmptyKey() { return 0; } - static inline BPKey getTombstoneKey() { return 1; } + static inline BPKey getEmptyKey() { return BPKey(0,0); } + static inline BPKey getTombstoneKey() { return BPKey(1,0); } static inline unsigned getHashValue(const BPKey& K) { return K.Raw & ~0x1; } static bool isEqual(const BPKey& K1, const BPKey& K2) { Modified: llvm/trunk/include/llvm/Bitcode/Serialize.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Bitcode/Serialize.h?rev=43721&r1=43720&r2=43721&view=diff ============================================================================== --- llvm/trunk/include/llvm/Bitcode/Serialize.h (original) +++ llvm/trunk/include/llvm/Bitcode/Serialize.h Mon Nov 5 12:13:03 2007 @@ -32,6 +32,7 @@ public: Serializer(BitstreamWriter& stream, unsigned BlockID = 0); + ~Serializer(); template <typename T> _______________________________________________ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits