Skip to content

Commit

Permalink
refine the output
Browse files Browse the repository at this point in the history
  • Loading branch information
VaynNecol committed Jan 6, 2025
1 parent 94dea41 commit a635d9d
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions rap/src/analysis/rcanary/ranalyzer/intra_visitor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2356,11 +2356,7 @@ impl<'tcx, 'ctx, 'a> IntraFlowAnalysis<'tcx, 'ctx, 'a> {
let fn_name = get_name(self.tcx(), self.did)
.unwrap_or_else(|| Symbol::intern("no symbol available"));

rap_warn!(
"Memory leak detected in function {:} {:?}",
fn_name,
self.body().span
);
rap_warn!("Double free detected in function {:}", fn_name);
let source = span_to_source_code(self.body().span);
let file = span_to_filename(self.body().span);
let mut snippet = Snippet::source(&source)
Expand All @@ -2378,13 +2374,13 @@ impl<'tcx, 'ctx, 'a> IntraFlowAnalysis<'tcx, 'ctx, 'a> {
.label("Memory Leak Candidates."),
);
}
rap_warn!(
"{}",
format!(
"RCanary: LeakItem Candidates: {:?}, {:?}",
source.kind, source.source_info.span
)
);
// rap_warn!(
// "{}",
// format!(
// "RCanary: LeakItem Candidates: {:?}, {:?}",
// source.kind, source.source_info.span
// )
// );
}

let message = Level::Warning
Expand Down

0 comments on commit a635d9d

Please sign in to comment.