[PATCH] D32466: [llvm-objdump] Don't attempt to print lines beyond the end of file

Petr Hosek via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 24 21:11:12 PDT 2017


phosek added a comment.

Is it fine to check-in executable? I saw that there're couple already in Inputs for llvm-objdump tests. I'm struggling to reproduce this with just pure llvm-mc and llvm-objdump, but I have a minimal reproducer that works with Clang and produces tiny (1.6k) ELF binary. The problems is that lines in `LineBuffer` are stored in `std::vector` which is allocated in chunks, so even if the debug info points beyond the end of the file, say line 15 in a file which has 14 lines (that typically happens because of comments), this still wouldn't segfault because the vector will have 16 items, but if you can make it point to line 17, it'll segfault (which is what my reproducer does).


Repository:
  rL LLVM

https://reviews.llvm.org/D32466





More information about the llvm-commits mailing list