summaryrefslogtreecommitdiff
path: root/tools/llvm-objdump
diff options
context:
space:
mode:
Diffstat (limited to 'tools/llvm-objdump')
-rw-r--r--tools/llvm-objdump/MCFunction.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/llvm-objdump/MCFunction.cpp b/tools/llvm-objdump/MCFunction.cpp
index eef58cd13e..4a4f9d5e50 100644
--- a/tools/llvm-objdump/MCFunction.cpp
+++ b/tools/llvm-objdump/MCFunction.cpp
@@ -46,7 +46,10 @@ MCFunction::createFunctionFromMC(StringRef Name, const MCDisassembler *DisAsm,
int64_t Imm = Inst.getOperand(0).getImm();
// FIXME: Distinguish relocations from nop jumps.
if (Imm != 0) {
- assert(Index+Imm+Size < End && "Branch out of function.");
+ if (Index+Imm+Size >= End) {
+ Instructions.push_back(MCDecodedInst(Index, Size, Inst));
+ continue; // Skip branches that leave the function.
+ }
Splits.insert(Index+Imm+Size);
}
}