[RuntimeDyld] fix too-small-bitmask error
authorNick Desaulniers <ndesaulniers@google.com>
Sat, 1 Jun 2019 04:51:26 +0000 (04:51 +0000)
committerNick Desaulniers <ndesaulniers@google.com>
Sat, 1 Jun 2019 04:51:26 +0000 (04:51 +0000)
commitb380846a125d2bd1e9b92882c56941137fa765f6
tree4f0c42387b39dcebe3dbf2852c64aaf8eb5b635c
parent4e875464df0ff84f7edb5d94be453e7ed28f06ad
[RuntimeDyld] fix too-small-bitmask error

Summary:
This was flagged in https://www.viva64.com/en/b/0629/ under "Snippet No.
33".

It seems that this statement is doing the standard bitwise trick for
adjusting a value to have a specific alignment.

The issue is that getStubAlignment() returns an unsigned, while DataSize
is declared a uint64_t. The right hand side of the expression is not
extended to 64b before bitwise negation, resulting in the top half of
the mask being 0s, which is not correct for realignment.

Reviewers: lhames, MaskRay

Reviewed By: MaskRay

Subscribers: RKSimon, MaskRay, hiraditya, llvm-commits, srhines

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D62227

llvm-svn: 362286
llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp