[llvm] r358824 - [JITLink] Silence some MSVC implicit cast warnings.
Lang Hames via llvm-commits
llvm-commits at lists.llvm.org
Sat Apr 20 11:30:16 PDT 2019
Author: lhames
Date: Sat Apr 20 11:30:16 2019
New Revision: 358824
URL: http://llvm.org/viewvc/llvm-project?rev=358824&view=rev
Log:
[JITLink] Silence some MSVC implicit cast warnings.
Modified:
llvm/trunk/lib/ExecutionEngine/JITLink/JITLink_MachO_x86_64.cpp
Modified: llvm/trunk/lib/ExecutionEngine/JITLink/JITLink_MachO_x86_64.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/JITLink/JITLink_MachO_x86_64.cpp?rev=358824&r1=358823&r2=358824&view=diff
==============================================================================
--- llvm/trunk/lib/ExecutionEngine/JITLink/JITLink_MachO_x86_64.cpp (original)
+++ llvm/trunk/lib/ExecutionEngine/JITLink/JITLink_MachO_x86_64.cpp Sat Apr 20 11:30:16 2019
@@ -227,7 +227,7 @@ private:
AtomToFix = &*AtomToFixOrErr;
}
- if (FixupAddress + (1 << RI.r_length) >
+ if (FixupAddress + static_cast<JITTargetAddress>(1 << RI.r_length) >
AtomToFix->getAddress() + AtomToFix->getContent().size())
return make_error<JITLinkError>(
"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<JITTargetAddress>(1 << (*Kind - PCRel32Minus1Anon));
JITTargetAddress TargetAddress =
FixupAddress + 4 + Delta + *(const ulittle32_t *)FixupContent;
if (auto TargetAtomOrErr = G.findAtomByAddress(TargetAddress))
More information about the llvm-commits
mailing list