diff --git a/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp b/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp index a45ed0e56553d4..e338a2ebfc9c2c 100644 --- a/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp +++ b/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp @@ -734,7 +734,7 @@ DWARFContext::DWARFContext(std::unique_ptr DObj, : DIContext(CK_DWARF), RecoverableErrorHandler(RecoverableErrorHandler), WarningHandler(WarningHandler), DObj(std::move(DObj)) { - if (ThreadSafe) + if (!ThreadSafe) State.reset(new ThreadUnsafeDWARFContextState(*this, DWPName)); else State.reset(new ThreadSafeState(*this, DWPName));