aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2011-01-06 16:48:42 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2011-01-06 16:48:42 +0000
commit2f867a63daf99dc27830d4442a574a790e02f27e (patch)
tree5cf0150904f469dcf298e37775f2d0762dd608e4 /tools
parent8143a84c46b8d2fb58eddb46d84dd5d44d03cb6c (diff)
Correctly disassemble truncated asm.
Patch by Richard Simth. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122962 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools')
-rw-r--r--tools/llvm-mc/Disassembler.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/llvm-mc/Disassembler.cpp b/tools/llvm-mc/Disassembler.cpp
index e5c31ca598..c29d82a2cb 100644
--- a/tools/llvm-mc/Disassembler.cpp
+++ b/tools/llvm-mc/Disassembler.cpp
@@ -44,7 +44,7 @@ public:
uint64_t getExtent() const { return Bytes.size(); }
int readByte(uint64_t Addr, uint8_t *Byte) const {
- if (Addr > getExtent())
+ if (Addr >= getExtent())
return -1;
*Byte = Bytes[Addr].first;
return 0;