From 677727e8296a802385345db6fa65e68223f4597a Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sat, 13 Aug 2022 14:28:03 +0200 Subject: Vendor import of llvm-project branch release/15.x llvmorg-15.0.0-rc2-40-gfbd2950d8d0d. --- lld/MachO/EhFrame.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'lld/MachO/EhFrame.cpp') diff --git a/lld/MachO/EhFrame.cpp b/lld/MachO/EhFrame.cpp index 50d8accc0596..55a85f316cdd 100644 --- a/lld/MachO/EhFrame.cpp +++ b/lld/MachO/EhFrame.cpp @@ -58,17 +58,17 @@ uint32_t EhReader::readU32(size_t *off) const { return v; } -uint64_t EhReader::readPointer(size_t *off) const { - if (*off + wordSize > data.size()) +uint64_t EhReader::readPointer(size_t *off, uint8_t size) const { + if (*off + size > data.size()) failOn(*off, "unexpected end of CIE/FDE"); uint64_t v; - if (wordSize == 8) + if (size == 8) v = read64le(data.data() + *off); else { - assert(wordSize == 4); + assert(size == 4); v = read32le(data.data() + *off); } - *off += wordSize; + *off += size; return v; } -- cgit v1.3