| Index: courgette/disassembler_win32_x86.cc
|
| diff --git a/courgette/disassembler_win32_x86.cc b/courgette/disassembler_win32_x86.cc
|
| index 39cb695225fe8919fe746f4d3002411e4655ed1c..ed5785f439b9ece0bc4e6b6d16827035b37284c9 100644
|
| --- a/courgette/disassembler_win32_x86.cc
|
| +++ b/courgette/disassembler_win32_x86.cc
|
| @@ -466,12 +466,12 @@ void DisassemblerWin32X86::ParseRel32RelocsFromSection(const Section* section) {
|
| // addressing mode?
|
| const uint8* rel32 = NULL;
|
|
|
| - if (p + 5 < end_pointer) {
|
| + if (p + 5 <= end_pointer) {
|
| if (*p == 0xE8 || *p == 0xE9) { // jmp rel32 and call rel32
|
| rel32 = p + 1;
|
| }
|
| }
|
| - if (p + 6 < end_pointer) {
|
| + if (p + 6 <= end_pointer) {
|
| if (*p == 0x0F && (*(p+1) & 0xF0) == 0x80) { // Jcc long form
|
| if (p[1] != 0x8A && p[1] != 0x8B) // JPE/JPO unlikely
|
| rel32 = p + 2;
|
| @@ -503,7 +503,7 @@ void DisassemblerWin32X86::ParseRel32RelocsFromSection(const Section* section) {
|
| #if COURGETTE_HISTOGRAM_TARGETS
|
| ++rel32_target_rvas_[target_rva];
|
| #endif
|
| - p += 4;
|
| + p = rel32 + 4;
|
| continue;
|
| }
|
| }
|
|
|