[PATCH] D75110: Avoid dangling reference when indexing sections

serge via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 25 04:15:44 PST 2020


serge-sans-paille created this revision.
serge-sans-paille added reviewers: grimar, bkramer, nickdesaulniers.
Herald added subscribers: llvm-commits, arphaman, atanasyan, jrtc27, hiraditya, sdardis.
Herald added a project: LLVM.

Bug spotted by https://cookieplmonster.github.io/2020/02/01/emulator-bug-llvm-bug/

The blog post proposes a simple solution (using a std::deque instead of a smallvector to store section entries). They also propose an alternative, namely to avoid taking any section reference at all. This patch enforces the latter using a proxy class. I'm totally fine with the dequeue approach too, and will gladly update the patch if needed.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D75110

Files:
  llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp
  llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp
  llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.h
  llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h
  llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp
  llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.h
  llvm/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldCOFFAArch64.h
  llvm/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldCOFFI386.h
  llvm/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldCOFFThumb.h
  llvm/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldCOFFX86_64.h
  llvm/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldELFMips.cpp
  llvm/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldELFMips.h
  llvm/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldMachOAArch64.h
  llvm/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldMachOARM.h
  llvm/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldMachOI386.h
  llvm/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldMachOX86_64.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D75110.246411.patch
Type: text/x-patch
Size: 95131 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200225/bc94a333/attachment-0001.bin>


More information about the llvm-commits mailing list