From 24b7dd431e34956bdde79220e3e4b23e70a78284 Mon Sep 17 00:00:00 2001 From: Tim Northover Date: Sat, 18 Oct 2014 00:36:03 +0000 Subject: [PATCH] [mach-o] keep Windows library happy. &v[v.size()] may be invalid C++. llvm-svn: 220115 --- lld/lib/ReaderWriter/MachO/CompactUnwindPass.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lld/lib/ReaderWriter/MachO/CompactUnwindPass.cpp b/lld/lib/ReaderWriter/MachO/CompactUnwindPass.cpp index 77bd3e9bc432..3a8bf1f63ee1 100644 --- a/lld/lib/ReaderWriter/MachO/CompactUnwindPass.cpp +++ b/lld/lib/ReaderWriter/MachO/CompactUnwindPass.cpp @@ -137,7 +137,7 @@ public: _contents.resize(_commonEncodingsOffset + commonEncodings.size() * sizeof(uint32_t)); int32_t *commonEncodingsArea = - (int32_t *)&_contents[_commonEncodingsOffset]; + reinterpret_cast(_contents.data() + _commonEncodingsOffset); for (uint32_t encoding : commonEncodings) write32(*commonEncodingsArea++, _swap, encoding);