Analyzer fix for fallthrough switch cases

Fixes #23
This commit is contained in:
Luke Street 2024-01-06 22:57:41 -07:00
parent ee3b297f76
commit 59fe8069f8
1 changed files with 3 additions and 1 deletions

View File

@ -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)