forked from OSchip/llvm-project
[BOLT][PR] In some cases DB could be nullptr
Summary: When processing binary with -debug mode in some cases, BD could be nullptr. It will be better to fail later on assert than here with segfault. Closes https://github.com/facebookincubator/BOLT/pull/18 GitHub Author: Alexander Gryanko <xpahos@gmail.com> (cherry picked from FBD8650719)
This commit is contained in:
parent
72ecd12f2f
commit
07353e9590
|
@ -1017,8 +1017,9 @@ void BinaryFunction::disassemble(ArrayRef<uint8_t> FunctionData) {
|
|||
auto *TargetSymbol =
|
||||
BC.getOrCreateGlobalSymbol(TargetAddress, 0, 0, "DATAat");
|
||||
DEBUG(if (opts::Verbosity >= 2) {
|
||||
auto SectionName = BD ? BD->getSectionName() : "<unknown>";
|
||||
dbgs() << "Created DATAat sym: " << TargetSymbol->getName()
|
||||
<< " in section " << BD->getSectionName() << "\n";
|
||||
<< " in section " << SectionName << "\n";
|
||||
});
|
||||
return TargetSymbol;
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue