Skip to content

Commit f6c6e48

Browse files
Add source_flag method to Flag operation
1 parent 8cc5a88 commit f6c6e48

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

rust/src/low_level_il/operation.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1013,6 +1013,19 @@ where
10131013
// LLIL_FLAG, LLIL_FLAG_SSA
10141014
pub struct Flag;
10151015

1016+
impl<M, F> Operation<'_, M, F, Flag>
1017+
where
1018+
M: FunctionMutability,
1019+
F: FunctionForm,
1020+
{
1021+
pub fn source_flag(&self) -> CoreFlag {
1022+
self.function
1023+
.arch()
1024+
.flag_from_id(FlagId(self.op.operands[0] as u32))
1025+
.expect("Bad flag ID")
1026+
}
1027+
}
1028+
10161029
impl<M, F> Debug for Operation<'_, M, F, Flag>
10171030
where
10181031
M: FunctionMutability,

0 commit comments

Comments
 (0)