aboutsummaryrefslogtreecommitdiff
path: root/llvm/tools/llvm-objdump/llvm-objdump.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/tools/llvm-objdump/llvm-objdump.cpp')
-rw-r--r--llvm/tools/llvm-objdump/llvm-objdump.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/tools/llvm-objdump/llvm-objdump.cpp b/llvm/tools/llvm-objdump/llvm-objdump.cpp
index 984b3f5..6c95d36 100644
--- a/llvm/tools/llvm-objdump/llvm-objdump.cpp
+++ b/llvm/tools/llvm-objdump/llvm-objdump.cpp
@@ -1431,6 +1431,14 @@ static void disassembleObject(const Target *TheTarget, const ObjectFile *Obj,
outs() << CommentStream.str();
Comments.clear();
+ // If disassembly has failed, continue with the next instruction, to
+ // avoid analysing invalid/incomplete instruction information.
+ if (!Disassembled) {
+ outs() << "\n";
+ Index += Size;
+ continue;
+ }
+
// Try to resolve the target of a call, tail call, etc. to a specific
// symbol.
if (MIA && (MIA->isCall(Inst) || MIA->isUnconditionalBranch(Inst) ||