From 5f7c61fda0be70a2d16a56dc6457dd4878237dd9 Mon Sep 17 00:00:00 2001 From: James Wenzel Date: Wed, 14 Feb 2024 10:22:06 -0800 Subject: [PATCH] fix read/write fallthrough check --- crates/debugger/src/tui/draw.rs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/crates/debugger/src/tui/draw.rs b/crates/debugger/src/tui/draw.rs index fbee1c6a0031..585375b245f6 100644 --- a/crates/debugger/src/tui/draw.rs +++ b/crates/debugger/src/tui/draw.rs @@ -518,12 +518,11 @@ impl DebuggerContext<'_> { let stack_len = step.stack.len(); if stack_len > 0 { if let Some(accesses) = get_buffer_accesses(op, &step.stack) { - if let Some(read_access) = accesses.read { - if read_access.0 == self.active_buffer { - offset = Some(read_access.1.offset); - size = Some(read_access.1.size); - color = Some(Color::Cyan); - } + if accesses.read.as_ref().is_some_and(|a| a.0 == self.active_buffer) { + let read_access = accesses.read.unwrap(); + offset = Some(read_access.1.offset); + size = Some(read_access.1.size); + color = Some(Color::Cyan); } else if let Some(write_access) = accesses.write { // TODO: with MCOPY, it will be possible to both read from and write to the // memory buffer with the same opcode