From 07dec2953456f5a6bee6100498eeebdfcb1964a7 Mon Sep 17 00:00:00 2001 From: Mason Reed Date: Sun, 2 Feb 2025 22:10:32 -0500 Subject: Fix Rust apply_to_linear_object logic applying non basic block backed disasm lines --- rust/src/render_layer.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'rust/src') diff --git a/rust/src/render_layer.rs b/rust/src/render_layer.rs index 27d5e531..80ecc639 100644 --- a/rust/src/render_layer.rs +++ b/rust/src/render_layer.rs @@ -161,10 +161,9 @@ pub trait RenderLayer: Sized { Some((probe_line.ty, probe_line.basic_block.to_owned(), line_block)) }) .flat_map(|(line_ty, basic_block, lines)| { - match line_ty { - LinearDisassemblyLineType::CodeDisassemblyLineType => { + match (basic_block, line_ty) { + (Some(block), LinearDisassemblyLineType::CodeDisassemblyLineType) => { // Dealing with code lines. - let block = basic_block.expect("Code line has no basic block"); let function = block.function(); let text_lines = lines.into_iter().map(|line| line.contents).collect(); let new_text_lines = self.apply_to_block(&block, text_lines); -- cgit v1.3.1