Skip to content
Browse files

RuntimeDyld: workaround use-after-free bug (`Sections`)

Sections is SmallVector, and it grows sometimes, causing use-after-free bug somewhere.
  • Loading branch information
Nekotekina committed Feb 1, 2020
1 parent 2e038bf commit 9fb67ecaea741afe9ca59d4a8ba8b6428df76c99
Showing with 2 additions and 1 deletion.
  1. +2 −1 lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h
@@ -29,6 +29,7 @@
#include <map>
#include <system_error>
#include <unordered_map>
#include <deque>

using namespace llvm;
using namespace llvm::object;
@@ -251,7 +252,7 @@ class RuntimeDyldImpl {

// A list of all sections emitted by the dynamic linker. These sections are
// referenced in the code by means of their index in this list - SectionID.
typedef SmallVector<SectionEntry, 64> SectionList;
typedef std::deque<SectionEntry> SectionList;
SectionList Sections;

typedef unsigned SID; // Type for SectionIDs

0 comments on commit 9fb67ec

Please sign in to comment.
You can’t perform that action at this time.