Skip to content

Commit 6866a43

Browse files
committed
Fix the lifted GotoLabel in Rust printing the function in Debug impl
This was causing a lot of extra noise, where the function is kept just to ref for the tag name
1 parent d137070 commit 6866a43

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

rust/src/high_level_il/operation.rs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
use core::ffi;
2-
31
use binaryninjacore_sys::*;
2+
use core::ffi;
3+
use std::fmt::{Debug, Formatter};
44

55
use super::HighLevelILLiftedInstruction;
66
use crate::architecture::CoreIntrinsic;
@@ -9,7 +9,7 @@ use crate::rc::Ref;
99
use crate::string::{BnStrCompatible, BnString};
1010
use crate::variable::{ConstantData, SSAVariable, Variable};
1111

12-
#[derive(Clone, Debug, PartialEq, Eq)]
12+
#[derive(Clone, PartialEq, Eq)]
1313
pub struct GotoLabel {
1414
pub(crate) function: Ref<Function>,
1515
pub target: u64,
@@ -32,6 +32,15 @@ impl GotoLabel {
3232
}
3333
}
3434

35+
impl Debug for GotoLabel {
36+
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
37+
f.debug_struct("GotoLabel")
38+
.field("name", &self.name())
39+
.field("target", &self.target)
40+
.finish()
41+
}
42+
}
43+
3544
// ADC, SBB, RLC, RRC
3645
#[derive(Debug, Copy, Clone)]
3746
pub struct BinaryOpCarry {

0 commit comments

Comments
 (0)