@ -423,8 +423,7 @@ module Report = struct
let issue_type =
let issue_type =
if true _ branch then IssueType . condition_always_false else IssueType . condition_always_true
if true _ branch then IssueType . condition_always_false else IssueType . condition_always_true
in
in
let exn = Exceptions . Checkers ( issue_type , Localise . verbatim_desc desc ) in
Reporting . log_warning summary ~ loc : location issue_type desc
Reporting . log_warning summary ~ loc : location exn
(* special case for `exit` when we're at the end of a block / procedure *)
(* special case for `exit` when we're at the end of a block / procedure *)
| Sil . Call ( _ , Const ( Cfun pname ) , _ , _ , _ )
| Sil . Call ( _ , Const ( Cfun pname ) , _ , _ , _ )
when String . equal ( Typ . Procname . get_method pname ) " exit "
when String . equal ( Typ . Procname . get_method pname ) " exit "
@ -432,12 +431,8 @@ module Report = struct
()
()
| _ ->
| _ ->
let location = Sil . instr_get_loc instr in
let location = Sil . instr_get_loc instr in
let exn =
Reporting . log_error summary ~ loc : location IssueType . unreachable_code_after
Exceptions . Checkers
" Unreachable code after statement "
( IssueType . unreachable_code_after
, Localise . verbatim_desc " Unreachable code after statement " )
in
Reporting . log_error summary ~ loc : location exn
let check_binop_array_access :
let check_binop_array_access :
@ -670,8 +665,6 @@ module Report = struct
let report cond trace issue_type =
let report cond trace issue_type =
let location = PO . ConditionTrace . get_report_location trace in
let location = PO . ConditionTrace . get_report_location trace in
let description = PO . description cond trace in
let description = PO . description cond trace in
let error_desc = Localise . desc_buffer_overrun description in
let exn = Exceptions . Checkers ( issue_type , error_desc ) in
let trace =
let trace =
match TraceSet . choose_shortest ( PO . ConditionTrace . get_val_traces trace ) with
match TraceSet . choose_shortest ( PO . ConditionTrace . get_val_traces trace ) with
| trace ->
| trace ->
@ -679,7 +672,7 @@ module Report = struct
| exception _ ->
| exception _ ->
[ Errlog . make_trace_element 0 location description [] ]
[ Errlog . make_trace_element 0 location description [] ]
in
in
Reporting . log_error summary ~ loc : location ~ ltr : trace ex n
Reporting . log_error summary ~ loc : location ~ ltr : trace issue_type descriptio n
in
in
PO . ConditionSet . check_all ~ report cond_set
PO . ConditionSet . check_all ~ report cond_set