summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2011-07-22 18:35:09 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2011-07-22 18:35:09 +0000
commit83a162ef8591d26b6105114e83061c600eb89749 (patch)
treeca2c46c380f233079f5e8fc8b614b5f34b602f8b /tools
parente0a03143df398c17a435c136b14316fd43f27fb7 (diff)
downloadllvm-83a162ef8591d26b6105114e83061c600eb89749.tar.gz
llvm-83a162ef8591d26b6105114e83061c600eb89749.tar.bz2
llvm-83a162ef8591d26b6105114e83061c600eb89749.tar.xz
llvm-objdump: Skip branches that leave the current function.
In "normal" code these only happen when disassembling data, so we won't lose anything if we just drop them. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135786 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools')
-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);
}
}