From 59fe8069f84ef7fe4375e61218551e49625f4df5 Mon Sep 17 00:00:00 2001 From: Luke Street Date: Sat, 6 Jan 2024 22:57:41 -0700 Subject: [PATCH] Analyzer fix for fallthrough switch cases Fixes #23 --- src/analysis/slices.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/analysis/slices.rs b/src/analysis/slices.rs index 294cdac..ac02d41 100644 --- a/src/analysis/slices.rs +++ b/src/analysis/slices.rs @@ -248,7 +248,9 @@ impl FunctionSlices { StepResult::Continue | StepResult::LoadStore { .. } => { let next_address = ins_addr + 4; // If we already visited the next address, connect the blocks and end - if executor.visited(section.address as u32, next_address) { + if executor.visited(section.address as u32, next_address) + || self.blocks.contains_key(&next_address) + { self.blocks.insert(block_start, Some(next_address)); self.branches.insert(ins_addr, vec![next_address]); Ok(ExecCbResult::EndBlock)