summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Object
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Object')
-rw-r--r--llvm/lib/Object/MachOObjectFile.cpp2
-rw-r--r--llvm/lib/Object/WasmObjectFile.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Object/MachOObjectFile.cpp b/llvm/lib/Object/MachOObjectFile.cpp
index ae5efc52055..50dd476780e 100644
--- a/llvm/lib/Object/MachOObjectFile.cpp
+++ b/llvm/lib/Object/MachOObjectFile.cpp
@@ -107,7 +107,7 @@ getSectionPtr(const MachOObjectFile &O, MachOObjectFile::LoadCommandInfo L,
}
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
diff --git a/llvm/lib/Object/WasmObjectFile.cpp b/llvm/lib/Object/WasmObjectFile.cpp
index f822d07a253..2f91a973dda 100644
--- a/llvm/lib/Object/WasmObjectFile.cpp
+++ b/llvm/lib/Object/WasmObjectFile.cpp
@@ -995,7 +995,7 @@ Error WasmObjectFile::parseDataSection(ReadContext &Ctx) {
}
const uint8_t *WasmObjectFile::getPtr(size_t Offset) const {
- return reinterpret_cast<const uint8_t *>(getData().substr(Offset, 1).data());
+ return reinterpret_cast<const uint8_t *>(getData().data() + Offset);
}
const wasm::WasmObjectHeader &WasmObjectFile::getHeader() const {
OpenPOWER on IntegriCloud