diff --git a/llvm/lib/ExecutionEngine/Orc/MemoryMapper.cpp b/llvm/lib/ExecutionEngine/Orc/MemoryMapper.cpp --- a/llvm/lib/ExecutionEngine/Orc/MemoryMapper.cpp +++ b/llvm/lib/ExecutionEngine/Orc/MemoryMapper.cpp @@ -412,6 +412,7 @@ } SharedMemoryMapper::~SharedMemoryMapper() { + std::lock_guard Lock(Mutex); for (const auto &R : Reservations) { #if defined(LLVM_ON_UNIX) && !defined(__ANDROID__)