Skip to content

Commit 07dec29

Browse files
committed
Fix Rust apply_to_linear_object logic applying non basic block backed disasm lines
1 parent 160ae4e commit 07dec29

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

rust/src/render_layer.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,10 +161,9 @@ pub trait RenderLayer: Sized {
161161
Some((probe_line.ty, probe_line.basic_block.to_owned(), line_block))
162162
})
163163
.flat_map(|(line_ty, basic_block, lines)| {
164-
match line_ty {
165-
LinearDisassemblyLineType::CodeDisassemblyLineType => {
164+
match (basic_block, line_ty) {
165+
(Some(block), LinearDisassemblyLineType::CodeDisassemblyLineType) => {
166166
// Dealing with code lines.
167-
let block = basic_block.expect("Code line has no basic block");
168167
let function = block.function();
169168
let text_lines = lines.into_iter().map(|line| line.contents).collect();
170169
let new_text_lines = self.apply_to_block(&block, text_lines);

0 commit comments

Comments
 (0)