[RuntimeDyld] Add casts to make delta computation 64-bit.
authorLang Hames <lhames@gmail.com>
Wed, 15 Apr 2015 04:46:01 +0000 (04:46 +0000)
committerLang Hames <lhames@gmail.com>
Wed, 15 Apr 2015 04:46:01 +0000 (04:46 +0000)
Hopefully this will fix the i686/msvc build failure described at:
http://bb.pgr.jp/builders/ninja-clang-i686-msc18-R/builds/803

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234977 91177308-0d34-0410-b5e6-96231b3b80d8

lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp

index 66ecba30b18ba739876a8115584f9159eace0bf2..675063c81d65c6b0efa79cc932c2d9c66cd86e17 100644 (file)
@@ -244,7 +244,8 @@ unsigned char *RuntimeDyldMachOCRTPBase<Impl>::processFDE(unsigned char *P,
 }
 
 static int64_t computeDelta(SectionEntry *A, SectionEntry *B) {
-  int64_t ObjDistance = A->ObjAddress - B->ObjAddress;
+  int64_t ObjDistance =
+    static_cast<int64_t>(A->ObjAddress) - static_cast<int64_t>(B->ObjAddress);
   int64_t MemDistance = A->LoadAddress - B->LoadAddress;
   return ObjDistance - MemDistance;
 }