@ -40,10 +40,21 @@ module TransferFunctions (CFG : ProcCfg.S) = struct
Typ . Procname . pp pname
Typ . Procname . pp pname
in
in
let message =
let message =
Format . asprintf
match ap with
" Variable %a is indirectly annotated with %a (source %a) and is dereferenced without being checked for null "
| ( Var . LogicalVar _ , _ ) , _ ->
( MF . wrap_monospaced AccessPath . pp )
(* direct dereference without intermediate variable *)
ap MF . pp_monospaced annotation ( MF . wrap_monospaced CallSite . pp ) call_site
Format . asprintf
" The return value of %s is annotated with %a and is dereferenced without being checked for null at %a "
( MF . monospaced_to_string
( Typ . Procname . to_simplified_string ~ withclass : true ( CallSite . pname call_site ) ) )
MF . pp_monospaced annotation Location . pp loc
| _ ->
(* dereference with intermediate variable *)
Format . asprintf
" Variable %a is indirectly annotated with %a (source %a) and is dereferenced without being checked for null at %a "
( MF . wrap_monospaced AccessPath . pp )
ap MF . pp_monospaced annotation ( MF . wrap_monospaced CallSite . pp ) call_site Location . pp
loc
in
in
let exn = Exceptions . Checkers ( issue_kind , Localise . verbatim_desc message ) in
let exn = Exceptions . Checkers ( issue_kind , Localise . verbatim_desc message ) in
let summary = extras in
let summary = extras in