From 55245a2c76baeaebb032613617e426df899e9ee7 Mon Sep 17 00:00:00 2001 From: Oxore Date: Sun, 13 Oct 2024 23:50:21 +0300 Subject: Fix -fwalk and -ffollow-jumps bug I can't properly explain it and neither I can provide a concise test case, but the bug happened when I tried to decompile the binary of SEGA MegaDrive/Genesis game called DUNE 2 with reduced trace table. It is huge (1 MiB) to take it as a test case and also probably illegal. So anyway here is a fix. --- src/disasm.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/disasm.cpp b/src/disasm.cpp index bf72674..847d11d 100644 --- a/src/disasm.cpp +++ b/src/disasm.cpp @@ -195,9 +195,6 @@ void DisasmMap::Disasm( } } inside_code_span = s.walk && IsNextLikelyAnInstruction(node->op); - if (nested && !inside_code_span) { - return; - } at += node->size; // NOTE: There is not much information about a reference passed further, // so just don't add a reference of immediate if s.imm_labels is false @@ -236,6 +233,9 @@ void DisasmMap::Disasm( } } } + if (nested && !inside_code_span) { + return; + } } } -- cgit v1.2.3