[Reprodicuers] Check initialization

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

llvm-svn: 355055
This commit is contained in:
Jonas Devlieghere 2019-02-28 00:49:57 +00:00
parent 53e43f4d9e
commit 95bb3c3cc3
1 changed files with 4 additions and 0 deletions

View File

@ -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 {};
}