[PATCH] D148208: [llvm-readobj] fix unit test failure on 32bit machines

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 13 03:16:13 PDT 2023


jhenderson added a comment.

My inline suggestion could be tested by using a section with e.g. size 1 and a size tag value of 0x100000001, since on a 32-bit machine, that should not trigger the error (since 0x100000001 is truncated to 1), when an error is expected.



================
Comment at: llvm/tools/llvm-readobj/ELFDumper.cpp:6007
   std::vector<std::pair<std::string, std::string>> DynamicEntries;
   size_t MemtagGlobalsSz = 0;
+  uint64_t MemtagGlobals = 0;
----------------
The `size_t` here should probably be changed too, since in theory the dynamic entry value could be greater than the max value of size_t on a 32-bit machine. Using fixed-sized types is generally the approach taken elsewhere in the code, so `uint64_t` for both seems appropriate to me.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D148208



More information about the llvm-commits mailing list