MCPcopy Create free account
hub / github.com/CodeSentryAI/lockbud / dest_args0

Function dest_args0

src/detector/memory/mod.rs:20–35  ·  view source on GitHub ↗

Find dest and the first arg of a Call

(
    body: &Body<'tcx>,
    loc: Location,
)

Source from the content-addressed store, hash-verified

18
19/// Find dest and the first arg of a Call
20fn dest_args0<'tcx>(
21 body: &Body<'tcx>,
22 loc: Location,
23) -> Option<(Place<'tcx>, Option<Place<'tcx>>)> {
24 if let TerminatorKind::Call {
25 func: _func,
26 args,
27 destination,
28 ..
29 } = &body[loc.block].terminator().kind
30 {
31 let args0 = args.first().and_then(|op| op.node.place());
32 return Some((*destination, args0));
33 }
34 None
35}
36/// std::mem::drop(place);
37fn collect_manual_drop<'tcx>(
38 callgraph: &CallGraph<'tcx>,

Callers 2

collect_manual_dropFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected