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

David Blaikie dblaikie at gmail.com
Tue Apr 14 21:55:36 PDT 2015


On Tue, Apr 14, 2015 at 9:46 PM, Lang Hames <lhames at gmail.com> wrote:
> Author: lhames
> Date: Tue Apr 14 23:46:01 2015
> New Revision: 234977
>
> URL: http://llvm.org/viewvc/llvm-project?rev=234977&view=rev
> Log:
> [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
>
>
> Modified:
>     llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp
>
> Modified: llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp?rev=234977&r1=234976&r2=234977&view=diff
> ==============================================================================
> --- llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp (original)
> +++ llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp Tue Apr 14 23:46:01 2015
> @@ -244,7 +244,8 @@ unsigned char *RuntimeDyldMachOCRTPBase<
>  }
>
>  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);

What's the type of "ObjAddress" - should it be made 64 bit, if it
isn't already? (otherwise what's happening here?)

>    int64_t MemDistance = A->LoadAddress - B->LoadAddress;
>    return ObjDistance - MemDistance;
>  }
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits



More information about the llvm-commits mailing list