[lld] r220115 - [mach-o] keep Windows library happy.
Tim Northover
tnorthover at apple.com
Fri Oct 17 17:36:03 PDT 2014
Author: tnorthover
Date: Fri Oct 17 19:36:03 2014
New Revision: 220115
URL: http://llvm.org/viewvc/llvm-project?rev=220115&view=rev
Log:
[mach-o] keep Windows library happy.
&v[v.size()] may be invalid C++.
Modified:
lld/trunk/lib/ReaderWriter/MachO/CompactUnwindPass.cpp
Modified: lld/trunk/lib/ReaderWriter/MachO/CompactUnwindPass.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/MachO/CompactUnwindPass.cpp?rev=220115&r1=220114&r2=220115&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/MachO/CompactUnwindPass.cpp (original)
+++ lld/trunk/lib/ReaderWriter/MachO/CompactUnwindPass.cpp Fri Oct 17 19:36:03 2014
@@ -137,7 +137,7 @@ public:
_contents.resize(_commonEncodingsOffset +
commonEncodings.size() * sizeof(uint32_t));
int32_t *commonEncodingsArea =
- (int32_t *)&_contents[_commonEncodingsOffset];
+ reinterpret_cast<int32_t *>(_contents.data() + _commonEncodingsOffset);
for (uint32_t encoding : commonEncodings)
write32(*commonEncodingsArea++, _swap, encoding);
More information about the llvm-commits
mailing list