From 67cd0e1cd7a8f113c0145e7a869b0bb615e37c98 Mon Sep 17 00:00:00 2001 From: David Lively Date: Thu, 11 Apr 2019 10:50:56 -0700 Subject: [PATCH] More tweaking of annotation-reachability-cxx output Reviewed By: jvillard Differential Revision: D14891558 fbshipit-source-id: e37289acf --- infer/src/checkers/annotationReachability.ml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/infer/src/checkers/annotationReachability.ml b/infer/src/checkers/annotationReachability.ml index 4ea4458d9..d63c46e25 100644 --- a/infer/src/checkers/annotationReachability.ml +++ b/infer/src/checkers/annotationReachability.ml @@ -296,7 +296,9 @@ module CxxAnnotationSpecs = struct let pname_str = Typ.Procname.to_string pname in let i = Option.value (String.rindex pname_str ':') ~default:(-1) + 1 in let slen = String.length pname_str in - String.sub pname_str ~pos:0 ~len:i ^ chop_prefix (String.sub pname_str ~pos:i ~len:(slen - i)) + String.sub pname_str ~pos:0 ~len:i + ^ chop_prefix (String.sub pname_str ~pos:i ~len:(slen - i)) + ^ "()" let spec_from_config spec_name spec_cfg = @@ -349,10 +351,10 @@ module CxxAnnotationSpecs = struct let report_cxx_annotation_stack src_summary loc trace stack_str snk_pname call_loc = let src_pname = Summary.get_proc_name src_summary in let final_trace = List.rev (update_trace call_loc trace) in - let snk_pname_str = Typ.Procname.to_string snk_pname in - let src_pname_str = Typ.Procname.to_string src_pname in + let snk_pname_str = cxx_string_of_pname snk_pname in + let src_pname_str = cxx_string_of_pname src_pname in let description = - Format.asprintf "%s can reach %s:\n %s%s%s%s" src_desc snk_desc src_pname_str call_str + Format.asprintf "%s can reach %s:\n %s%s%s%s\n" src_desc snk_desc src_pname_str call_str stack_str snk_pname_str in let issue_type =