Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
21 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,16 @@ | ||
The result of pointer arithmetic is of type ptrdiff_t, which is not | ||
necessarily the same underlying type as ssize_t. | ||
|
||
--- a/llvm/tools/llvm-objcopy/MachO/MachOWriter.cpp 2022-06-11 00:47:36.000000000 +1000 | ||
+++ b/llvm/tools/llvm-objcopy/MachO/MachOWriter.cpp 2022-06-16 23:41:23.000000000 +1000 | ||
@@ -566,7 +566,7 @@ void MachOWriter::writeCodeSignatureData | ||
--- llvm-project-14.0.6.src/llvm/tools/llvm-objcopy/MachO/MachOWriter.cpp.orig 2022-06-23 02:46:24.000000000 +1000 | ||
+++ llvm-project-14.0.6.src/llvm/tools/llvm-objcopy/MachO/MachOWriter.cpp 2022-07-02 20:05:12.000000000 +1000 | ||
@@ -566,8 +566,8 @@ void MachOWriter::writeCodeSignatureData | ||
uint8_t *CurrHashWritePosition = HashWriteStart; | ||
while (CurrHashReadPosition < HashReadEnd) { | ||
StringRef Block(reinterpret_cast<char *>(CurrHashReadPosition), | ||
- std::min(HashReadEnd - CurrHashReadPosition, | ||
+ std::min(static_cast<ssize_t>(HashReadEnd - CurrHashReadPosition), | ||
static_cast<ssize_t>(CodeSignature.BlockSize))); | ||
- static_cast<ssize_t>(CodeSignature.BlockSize))); | ||
+ std::min(static_cast<size_t>(HashReadEnd - CurrHashReadPosition), | ||
+ static_cast<size_t>(CodeSignature.BlockSize))); | ||
SHA256 Hasher; | ||
Hasher.update(Block); | ||
StringRef Hash = Hasher.final(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- llvm-project-14.0.6.src/lld/MachO/SyntheticSections.cpp.orig 2022-06-23 02:46:24.000000000 +1000 | ||
+++ llvm-project-14.0.6.src/lld/MachO/SyntheticSections.cpp 2022-07-02 20:06:18.000000000 +1000 | ||
@@ -1190,7 +1190,8 @@ void CodeSignatureSection::writeHashes(u | ||
uint8_t *hashes = codeEnd + allHeadersSize; | ||
while (code < codeEnd) { | ||
StringRef block(reinterpret_cast<char *>(code), | ||
- std::min(codeEnd - code, static_cast<ssize_t>(blockSize))); | ||
+ std::min(static_cast<size_t>(codeEnd - code), | ||
+ static_cast<size_t>(blockSize))); | ||
SHA256 hasher; | ||
hasher.update(block); | ||
StringRef hash = hasher.final(); |