From 9fb67ecaea741afe9ca59d4a8ba8b6428df76c99 Mon Sep 17 00:00:00 2001 From: Nekotekina Date: Sat, 1 Feb 2020 17:21:47 +0300 Subject: [PATCH] RuntimeDyld: workaround use-after-free bug (`Sections`) Sections is SmallVector, and it grows sometimes, causing use-after-free bug somewhere. --- lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h b/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h index cec7b92b8c4..772116eca75 100644 --- a/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h +++ b/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h @@ -29,6 +29,7 @@ #include #include #include +#include using namespace llvm; using namespace llvm::object; @@ -251,7 +252,7 @@ protected: // 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 SectionList; + typedef std::deque SectionList; SectionList Sections; typedef unsigned SID; // Type for SectionIDs