hopefully "really" fix a type punning warning by defining the buffer as
authorChris Lattner <sabre@nondot.org>
Sun, 10 Feb 2013 06:07:16 +0000 (06:07 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 10 Feb 2013 06:07:16 +0000 (06:07 +0000)
type char, which can't have TBAA tags.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174826 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Bitcode/BitstreamReader.h

index 9a8c370f00475ba515e3825b48057dc8541a9cf3..48a6989deb51200270ce9036839e26744a18073e 100644 (file)
@@ -364,12 +364,13 @@ public:
     uint32_t R = uint32_t(CurWord);
 
     // Read the next word from the stream.
-    uint8_t buf[sizeof(word_t)] = {0};
-    BitStream->getBitcodeBytes().readBytes(NextChar, sizeof(buf), buf, NULL);
+    char buf[sizeof(word_t)] = {0};
+    BitStream->getBitcodeBytes().readBytes(NextChar, sizeof(buf),
+                                           (uint8_t*)buf, NULL);
     
     typedef support::detail::packed_endian_specific_integral
        <word_t, support::little, support::unaligned> Endian_T;
-    CurWord = *(Endian_T*)(void*)buf;
+    CurWord = *(Endian_T*)buf;
 
     NextChar += sizeof(word_t);