[PATCH] D93209: [libObject, llvm-readobj] - Reimplement `ELFFile<ELFT>::getEntry`.

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 21 01:21:11 PST 2020


grimar marked an inline comment as done.
grimar added inline comments.


================
Comment at: llvm/include/llvm/Object/ELF.h:629
+    return createError("can't read an entry at 0x" +
+                       Twine::utohexstr(Entry * sizeof(T)) +
+                       ": it goes past the end of the section (0x" +
----------------
hvdijk wrote:
> This multiplication does not produce consistent results across hosts, as size_t may or may not be 64 bits so the result may or may not be truncated to 32 bits. It's fairly harmless since it's just the error message that's affected, but it causes test failures on some hosts. The original code cast Entry to uint64_t before multiplying, I think the new code needs to do the same.
Thanks! This was already fixed in rG43327ba98da138d9d87e13f65675a0b600dae018


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D93209/new/

https://reviews.llvm.org/D93209



More information about the llvm-commits mailing list