|
|
@ -109,15 +109,16 @@ module Domain = struct
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let report_use_after_lifetime (var, _) ~use_loc ~invalidated_loc summary =
|
|
|
|
let report_use_after_lifetime (var, _) ~use_loc ~invalidated_loc summary =
|
|
|
|
let message =
|
|
|
|
if Var.appears_in_source_code var then
|
|
|
|
F.asprintf "Variable %a is used at line %a after its lifetime ended at %a" Var.pp var
|
|
|
|
let message =
|
|
|
|
Location.pp use_loc Location.pp invalidated_loc
|
|
|
|
F.asprintf "Variable %a is used at line %a after its lifetime ended at %a" Var.pp var
|
|
|
|
in
|
|
|
|
Location.pp use_loc Location.pp invalidated_loc
|
|
|
|
let ltr =
|
|
|
|
in
|
|
|
|
[ Errlog.make_trace_element 0 invalidated_loc "End of variable lifetime" []
|
|
|
|
let ltr =
|
|
|
|
; Errlog.make_trace_element 0 use_loc "Use of invalid variable" [] ]
|
|
|
|
[ Errlog.make_trace_element 0 invalidated_loc "End of variable lifetime" []
|
|
|
|
in
|
|
|
|
; Errlog.make_trace_element 0 use_loc "Use of invalid variable" [] ]
|
|
|
|
report message use_loc ltr summary
|
|
|
|
in
|
|
|
|
|
|
|
|
report message use_loc ltr summary
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(* complain if we do not have the right capability to access [var] *)
|
|
|
|
(* complain if we do not have the right capability to access [var] *)
|
|
|
|