mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-21 06:30:16 +00:00
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
This commit is contained in:
parent
e0a03143df
commit
83a162ef85
@ -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);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user