diff --git a/bolt/lib/Core/Exceptions.cpp b/bolt/lib/Core/Exceptions.cpp --- a/bolt/lib/Core/Exceptions.cpp +++ b/bolt/lib/Core/Exceptions.cpp @@ -184,12 +184,19 @@ if (LPAddress < Address || LPAddress > Address + getSize()) { BinaryFunction *Fragment = BC.getBinaryFunctionContainingAddress(LPAddress); - assert(Fragment != nullptr && - "BOLT-ERROR: cannot find landing pad fragment"); + if (Fragment == nullptr) { + errs() << formatv( + "BOLT-ERROR: cannot find function for landing pad {0:x}\n", + LPAddress); + exit(1); + } BC.addInterproceduralReference(this, Fragment->getAddress()); BC.processInterproceduralReferences(); - assert(isParentOrChildOf(*Fragment) && - "BOLT-ERROR: cannot have landing pads in different functions"); + if (!isParentOrChildOf(*Fragment)) { + errs() << formatv("BOLT-ERROR: {0} has landing pad in {1}\n", *this, + *Fragment); + exit(1); + } setHasIndirectTargetToSplitFragment(true); BC.addFragmentsToSkip(this); return;