Skip to content

Commit

Permalink
hopefully "really" fix a type punning warning by defining the buffer as
Browse files Browse the repository at this point in the history
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
  • Loading branch information
lattner committed Feb 10, 2013
1 parent bf8f4cb commit 10b043e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions include/llvm/Bitcode/BitstreamReader.h
Original file line number Diff line number Diff line change
Expand Up @@ -364,12 +364,13 @@ class BitstreamCursor {
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);

Expand Down

0 comments on commit 10b043e

Please sign in to comment.