[PATCH] D91787: [llvm-readobj] - Don't crash when relocation table goes past the EOF.

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 20 03:03:40 PST 2020


grimar added a comment.

In D91787#2407439 <https://reviews.llvm.org/D91787#2407439>, @jhenderson wrote:

> Would adding `--implicit-check-not=warning:` to the test cases be useful?

Perhaps we could can add it to each test where we print warnings jsut in case.
I've added it.



================
Comment at: llvm/tools/llvm-readobj/ELFDumper.cpp:131-132
+      : FileName(Owner.getFileName()), Owner(&Owner) {}
   DynRegionInfo(const uint8_t *A, uint64_t S, uint64_t ES, StringRef ObjName)
-      : Addr(A), Size(S), EntSize(ES), FileName(ObjName) {}
+      : Addr(A), Size(S), EntSize(ES), FileName(ObjName), Owner(nullptr) {}
 
----------------
jhenderson wrote:
> Can't you change users of this overload in the same way, so that there's always an object?
I was not sure how much it is useful (because this constructor is only used in `createDRI`, which do Offset/Size check before creating the `DynRegionInfo`). But I've tried and seems it allows to simplify the code a bit.

Done.


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

https://reviews.llvm.org/D91787



More information about the llvm-commits mailing list