summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/binary-reader-objdump.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/binary-reader-objdump.cc b/src/binary-reader-objdump.cc
index eac21ef3..23f2016f 100644
--- a/src/binary-reader-objdump.cc
+++ b/src/binary-reader-objdump.cc
@@ -587,7 +587,10 @@ Result BinaryReaderObjdumpDisassemble::OnOpcode(Opcode opcode) {
}
if (last_opcode_end) {
- if (state->offset != last_opcode_end + opcode.GetLength()) {
+ // Takes care of cases where opcode's bytes was a non-canonical leb128
+ // encoding. In this case, opcode.GetLength() under-reports the length,
+ // since it canonicalizes the opcode.
+ if (state->offset < last_opcode_end + opcode.GetLength()) {
Opcode missing_opcode = Opcode::FromCode(data_[last_opcode_end]);
const char* opcode_name = missing_opcode.GetName();
fprintf(stderr,