mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-27 06:54:30 +00:00
Fix memory corruption problem
llvm-svn: 6003
This commit is contained in:
parent
cf277f9143
commit
ff78e3f3e4
@ -163,7 +163,8 @@ static inline void output(unsigned i, std::deque<unsigned char> &Out,
|
||||
if (pos == -1)
|
||||
Out.insert(Out.end(), (unsigned char*)&i, (unsigned char*)&i+4);
|
||||
else
|
||||
*(unsigned*)&Out[pos] = i;
|
||||
// This cannot use block copy because deques are not guaranteed contiguous!
|
||||
std::copy((unsigned char*)&i, 4+(unsigned char*)&i, Out.begin()+pos);
|
||||
#else
|
||||
if (pos == -1) { // Be endian clean, little endian is our friend
|
||||
Out.push_back((unsigned char)i);
|
||||
|
Loading…
x
Reference in New Issue
Block a user