]> granicus.if.org Git - llvm/commitdiff
Merging r234977:
authorTom Stellard <thomas.stellard@amd.com>
Thu, 7 May 2015 22:09:33 +0000 (22:09 +0000)
committerTom Stellard <thomas.stellard@amd.com>
Thu, 7 May 2015 22:09:33 +0000 (22:09 +0000)
------------------------------------------------------------------------
r234977 | lhames | 2015-04-15 00:46:01 -0400 (Wed, 15 Apr 2015) | 5 lines

[RuntimeDyld] Add casts to make delta computation 64-bit.

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/branches/release_36@236784 91177308-0d34-0410-b5e6-96231b3b80d8

lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp

index 2851e48e90d22aa45308b3752fad948dce1fef37..d75be280786252ba8b9df82de3cd36e41e2472b7 100644 (file)
@@ -243,7 +243,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;
 }