Index: llvm/trunk/lib/Object/MachOObjectFile.cpp =================================================================== --- llvm/trunk/lib/Object/MachOObjectFile.cpp +++ llvm/trunk/lib/Object/MachOObjectFile.cpp @@ -107,7 +107,7 @@ } static const char *getPtr(const MachOObjectFile &O, size_t Offset) { - return O.getData().substr(Offset, 1).data(); + return O.getData().data() + Offset; } static MachO::nlist_base Index: llvm/trunk/lib/Object/WasmObjectFile.cpp =================================================================== --- llvm/trunk/lib/Object/WasmObjectFile.cpp +++ llvm/trunk/lib/Object/WasmObjectFile.cpp @@ -995,7 +995,7 @@ } const uint8_t *WasmObjectFile::getPtr(size_t Offset) const { - return reinterpret_cast(getData().substr(Offset, 1).data()); + return reinterpret_cast(getData().data() + Offset); } const wasm::WasmObjectHeader &WasmObjectFile::getHeader() const {