[Lldb-commits] [lldb] r355055 - [Reprodicuers] Check initialization

Jonas Devlieghere via lldb-commits lldb-commits at lists.llvm.org
Wed Feb 27 16:49:57 PST 2019


Author: jdevlieghere
Date: Wed Feb 27 16:49:57 2019
New Revision: 355055

URL: http://llvm.org/viewvc/llvm-project?rev=355055&view=rev
Log:
[Reprodicuers] Check initialization

If the reproducer is not initialzied, the call to ::Instance() will
result in an assertion.

Modified:
    lldb/trunk/source/API/SBReproducerPrivate.h

Modified: lldb/trunk/source/API/SBReproducerPrivate.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBReproducerPrivate.h?rev=355055&r1=355054&r2=355055&view=diff
==============================================================================
--- lldb/trunk/source/API/SBReproducerPrivate.h (original)
+++ lldb/trunk/source/API/SBReproducerPrivate.h Wed Feb 27 16:49:57 2019
@@ -58,10 +58,14 @@ private:
 };
 
 inline InstrumentationData GetInstrumentationData() {
+  if (!lldb_private::repro::Reproducer::Initialized())
+    return {};
+
   if (auto *g = lldb_private::repro::Reproducer::Instance().GetGenerator()) {
     auto &p = g->GetOrCreate<SBProvider>();
     return {p.GetSerializer(), p.GetRegistry()};
   }
+
   return {};
 }
 




More information about the lldb-commits mailing list