forked from OSchip/llvm-project
				
			[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:
		
							parent
							
								
									53e43f4d9e
								
							
						
					
					
						commit
						95bb3c3cc3
					
				| 
						 | 
					@ -58,10 +58,14 @@ private:
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
inline InstrumentationData GetInstrumentationData() {
 | 
					inline InstrumentationData GetInstrumentationData() {
 | 
				
			||||||
 | 
					  if (!lldb_private::repro::Reproducer::Initialized())
 | 
				
			||||||
 | 
					    return {};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  if (auto *g = lldb_private::repro::Reproducer::Instance().GetGenerator()) {
 | 
					  if (auto *g = lldb_private::repro::Reproducer::Instance().GetGenerator()) {
 | 
				
			||||||
    auto &p = g->GetOrCreate<SBProvider>();
 | 
					    auto &p = g->GetOrCreate<SBProvider>();
 | 
				
			||||||
    return {p.GetSerializer(), p.GetRegistry()};
 | 
					    return {p.GetSerializer(), p.GetRegistry()};
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  return {};
 | 
					  return {};
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue