MCPcopy Create free account
hub / github.com/Vector35/binaryninja-api / if_expr

Method if_expr

rust/src/low_level_il/lifting.rs:1097–1136  ·  view source on GitHub ↗
(
        &'a self,
        cond: C,
        true_label: &'b mut LowLevelILLabel,
        false_label: &'b mut LowLevelILLabel,
    )

Source from the content-addressed store, hash-verified

1095 // TODO: LLIL_JUMP_TO
1096
1097 pub fn if_expr<'a: 'b, 'b, C>(
1098 &'a self,
1099 cond: C,
1100 true_label: &'b mut LowLevelILLabel,
1101 false_label: &'b mut LowLevelILLabel,
1102 ) -> LowLevelILExpression<'a, A, Mutable, NonSSA<LiftedNonSSA>, VoidExpr>
1103 where
1104 C: LiftableLowLevelIL<'b, A, Result = ValueExpr>,
1105 {
1106 use binaryninjacore_sys::BNLowLevelILIf;
1107
1108 let cond = C::lift(self, cond);
1109
1110 let mut raw_true_label = BNLowLevelILLabel::from(*true_label);
1111 let mut raw_false_label = BNLowLevelILLabel::from(*false_label);
1112 let expr_idx = unsafe {
1113 BNLowLevelILIf(
1114 self.handle,
1115 cond.index.0 as u64,
1116 &mut raw_true_label,
1117 &mut raw_false_label,
1118 )
1119 };
1120
1121 // Update the labels after they have been resolved.
1122 let mut new_true_label = LowLevelILLabel::from(raw_true_label);
1123 let mut new_false_label = LowLevelILLabel::from(raw_false_label);
1124 if let Some(location) = true_label.location {
1125 new_true_label.location = Some(location);
1126 self.update_label_map_for_label(&new_true_label);
1127 }
1128 if let Some(location) = false_label.location {
1129 new_false_label.location = Some(location);
1130 self.update_label_map_for_label(&new_false_label);
1131 }
1132 *true_label = new_true_label;
1133 *false_label = new_false_label;
1134
1135 LowLevelILExpression::new(self, LowLevelExpressionIndex(expr_idx))
1136 }
1137
1138 // TODO: Wtf are these lifetimes??
1139 pub fn goto<'a: 'b, 'b>(

Callers 1

instruction_llilMethod · 0.45

Calls 3

liftFunction · 0.85

Tested by

no test coverage detected