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

Method wrap_raw

rust/src/basic_block.rs:65–89  ·  view source on GitHub ↗
(raw: &'b Self::Raw, context: &'b Self::Context)

Source from the content-addressed store, hash-verified

63 }
64
65 unsafe fn wrap_raw<'b>(raw: &'b Self::Raw, context: &'b Self::Context) -> Self::Wrapped<'b> {
66 let edge_target = Guard::new(
67 BasicBlock::from_raw(raw.target, context.orig_block.context.clone()),
68 raw,
69 );
70 let orig_block = Guard::new(
71 BasicBlock::from_raw(
72 context.orig_block.handle,
73 context.orig_block.context.clone(),
74 ),
75 raw,
76 );
77
78 let (source, target) = match context.dir {
79 EdgeDirection::Incoming => (edge_target, orig_block),
80 EdgeDirection::Outgoing => (orig_block, edge_target),
81 };
82
83 Edge {
84 branch: raw.type_,
85 back_edge: raw.backEdge,
86 source,
87 target,
88 }
89 }
90}
91
92pub trait BlockContext: Clone + Sync + Send + Sized {

Callers

nothing calls this directly

Calls 1

cloneMethod · 0.45

Tested by

no test coverage detected