[PATCH] D126786: [Object][COFF] Add table ptr checks but don't hard-error
Martin Storsjö via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 1 13:18:48 PDT 2022
mstorsjo added a comment.
This needs a testcase - maybe one for llvm-readobj or llvm-objdump, to make sure it doesn't error out on such an object file. I believe you're familiar with the obj2yaml/yaml2obj kind of test object files used (based on some other patch of yours) - I guess it should be kinda doable to pick an existing minimal-ish yaml for e.g. an executable, and modify it to reach the state where the import tables point out of bounds, to trigger the issue (producing a case that didn't use to work before but now works).
================
Comment at: llvm/lib/Object/COFFObjectFile.cpp:608
return E;
+ if (Error E = checkOffset(Data, IntPtr, DataEntry->Size)) { // !
+ consumeError(std::move(E));
----------------
The `// !` comments should be left out when upstreaming the patch.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D126786/new/
https://reviews.llvm.org/D126786
More information about the llvm-commits
mailing list