From dfc3a4f6ffde04f0977c5a76877ce2054a13dde8 Mon Sep 17 00:00:00 2001 From: Lang Hames Date: Sat, 20 Apr 2019 18:30:16 +0000 Subject: [PATCH] [JITLink] Silence some MSVC implicit cast warnings. llvm-svn: 358824 --- llvm/lib/ExecutionEngine/JITLink/JITLink_MachO_x86_64.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/llvm/lib/ExecutionEngine/JITLink/JITLink_MachO_x86_64.cpp b/llvm/lib/ExecutionEngine/JITLink/JITLink_MachO_x86_64.cpp index fd058fa..0e1dd23 100644 --- a/llvm/lib/ExecutionEngine/JITLink/JITLink_MachO_x86_64.cpp +++ b/llvm/lib/ExecutionEngine/JITLink/JITLink_MachO_x86_64.cpp @@ -227,7 +227,7 @@ private: AtomToFix = &*AtomToFixOrErr; } - if (FixupAddress + (1 << RI.r_length) > + if (FixupAddress + static_cast(1 << RI.r_length) > AtomToFix->getAddress() + AtomToFix->getContent().size()) return make_error( "Relocation content extends past end of fixup atom"); @@ -290,7 +290,8 @@ private: case PCRel32Minus1Anon: case PCRel32Minus2Anon: case PCRel32Minus4Anon: { - JITTargetAddress Delta = 1 << (*Kind - PCRel32Minus1Anon); + JITTargetAddress Delta = + static_cast(1 << (*Kind - PCRel32Minus1Anon)); JITTargetAddress TargetAddress = FixupAddress + 4 + Delta + *(const ulittle32_t *)FixupContent; if (auto TargetAtomOrErr = G.findAtomByAddress(TargetAddress)) -- 2.7.4