[PATCH] D62227: [RuntimeDyld] fix too-small-bitmask error
Nick Desaulniers via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue May 21 18:36:36 PDT 2019
nickdesaulniers created this revision.
nickdesaulniers added a reviewer: lhames.
Herald added subscribers: llvm-commits, hiraditya.
Herald added a project: LLVM.
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.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D62227
Files:
llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp
Index: llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp
===================================================================
--- llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp
+++ llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp
@@ -836,7 +836,7 @@
// Align DataSize to stub alignment if we have any stubs (PaddingSize will
// have been increased above to account for this).
if (StubBufSize > 0)
- DataSize &= ~(getStubAlignment() - 1);
+ DataSize &= ~(getStubAlignment() - 1UL);
}
LLVM_DEBUG(dbgs() << "emitSection SectionID: " << SectionID << " Name: "
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D62227.200624.patch
Type: text/x-patch
Size: 615 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190522/2b1d4d8b/attachment.bin>
More information about the llvm-commits
mailing list