diff options
| author | Benjamin Kramer <benny.kra@googlemail.com> | 2011-07-22 18:35:09 +0000 |
|---|---|---|
| committer | Benjamin Kramer <benny.kra@googlemail.com> | 2011-07-22 18:35:09 +0000 |
| commit | cb2d7bee35011c0d7b00127000b012ced75706c1 (patch) | |
| tree | a94cdfa3722983b138ae8761231b263187cbcb91 | |
| parent | 3fa7ca84d9f9f08347a553d254997fb43203e4fe (diff) | |
| download | bcm5719-llvm-cb2d7bee35011c0d7b00127000b012ced75706c1.tar.gz bcm5719-llvm-cb2d7bee35011c0d7b00127000b012ced75706c1.zip | |
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.
llvm-svn: 135786
| -rw-r--r-- | llvm/tools/llvm-objdump/MCFunction.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/tools/llvm-objdump/MCFunction.cpp b/llvm/tools/llvm-objdump/MCFunction.cpp index eef58cd13e0..4a4f9d5e50a 100644 --- a/llvm/tools/llvm-objdump/MCFunction.cpp +++ b/llvm/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); } } |

