diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2022-03-20 11:40:34 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2022-05-14 11:43:05 +0000 |
commit | 349cc55c9796c4596a5b9904cd3281af295f878f (patch) | |
tree | 410c5a785075730a35f1272ca6a7adf72222ad03 /contrib/llvm-project/llvm/lib/Support/BinaryStreamReader.cpp | |
parent | cb2ae6163174b90e999326ecec3699ee093a5d43 (diff) | |
parent | c0981da47d5696fe36474fcf86b4ce03ae3ff818 (diff) |
Diffstat (limited to 'contrib/llvm-project/llvm/lib/Support/BinaryStreamReader.cpp')
-rw-r--r-- | contrib/llvm-project/llvm/lib/Support/BinaryStreamReader.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/contrib/llvm-project/llvm/lib/Support/BinaryStreamReader.cpp b/contrib/llvm-project/llvm/lib/Support/BinaryStreamReader.cpp index a0434bdc6115..2fe450db11dd 100644 --- a/contrib/llvm-project/llvm/lib/Support/BinaryStreamReader.cpp +++ b/contrib/llvm-project/llvm/lib/Support/BinaryStreamReader.cpp @@ -72,10 +72,10 @@ Error BinaryStreamReader::readSLEB128(int64_t &Dest) { } Error BinaryStreamReader::readCString(StringRef &Dest) { - uint32_t OriginalOffset = getOffset(); - uint32_t FoundOffset = 0; + uint64_t OriginalOffset = getOffset(); + uint64_t FoundOffset = 0; while (true) { - uint32_t ThisOffset = getOffset(); + uint64_t ThisOffset = getOffset(); ArrayRef<uint8_t> Buffer; if (auto EC = readLongestContiguousChunk(Buffer)) return EC; @@ -100,8 +100,8 @@ Error BinaryStreamReader::readCString(StringRef &Dest) { } Error BinaryStreamReader::readWideString(ArrayRef<UTF16> &Dest) { - uint32_t Length = 0; - uint32_t OriginalOffset = getOffset(); + uint64_t Length = 0; + uint64_t OriginalOffset = getOffset(); const UTF16 *C; while (true) { if (auto EC = readObject(C)) @@ -110,7 +110,7 @@ Error BinaryStreamReader::readWideString(ArrayRef<UTF16> &Dest) { break; ++Length; } - uint32_t NewOffset = getOffset(); + uint64_t NewOffset = getOffset(); setOffset(OriginalOffset); if (auto EC = readArray(Dest, Length)) @@ -145,7 +145,7 @@ Error BinaryStreamReader::readSubstream(BinarySubstreamRef &Ref, return readStreamRef(Ref.StreamData, Length); } -Error BinaryStreamReader::skip(uint32_t Amount) { +Error BinaryStreamReader::skip(uint64_t Amount) { if (Amount > bytesRemaining()) return make_error<BinaryStreamError>(stream_error_code::stream_too_short); Offset += Amount; @@ -166,7 +166,7 @@ uint8_t BinaryStreamReader::peek() const { } std::pair<BinaryStreamReader, BinaryStreamReader> -BinaryStreamReader::split(uint32_t Off) const { +BinaryStreamReader::split(uint64_t Off) const { assert(getLength() >= Off); BinaryStreamRef First = Stream.drop_front(Offset); |