[ObjCopy] Fix type mismatch in writeCodeSignatureData()
authorJoshua Root <jmr@macports.org>
Fri, 24 Jun 2022 16:12:55 +0000 (09:12 -0700)
committerDaniel Rodríguez Troitiño <danielrodriguez@fb.com>
Fri, 24 Jun 2022 16:14:47 +0000 (09:14 -0700)
commit146f486ba337299b88df303a6f1cf99f60df03cc
tree5ceca85532bf451a6d344626b5bf750f9b255c16
parente422c0d3b26eaf3e5646960351d4fe6ff7c0b573
[ObjCopy] Fix type mismatch in writeCodeSignatureData()

The result of pointer subtraction is of type ptrdiff_t, which is not necessarily the same underlying type as ssize_t. This can lead to a compilation error since std::min requires both parameters to be the same type.

Fixes: https://github.com/llvm/llvm-project/issues/54846

Reviewed By: alexander-shaposhnikov, drodriguez, jhenderson

Differential Revision: https://reviews.llvm.org/D128117
llvm/lib/ObjCopy/MachO/MachOWriter.cpp