Fix ERROR RUNNING BACKEND

Reviewed By: mbouaziz

Differential Revision: D13082108

fbshipit-source-id: 1c21b9e9f
master
Dino Distefano 6 years ago committed by Facebook Github Bot
parent 716caf91bf
commit c4701f8a04

@ -92,9 +92,16 @@ let log_issue_external procname severity ~loc ~ltr ?access issue_type error_mess
let log_error_using_state summary exn = let log_error_using_state summary exn =
if !BiabductionConfig.footprint then if !BiabductionConfig.footprint then
let node = Errlog.BackendNode {node= State.get_node_exn ()} in let node' =
match State.get_node () with
| Some n ->
n
| None ->
Procdesc.get_start_node (Summary.get_proc_desc summary)
in
let node = Errlog.BackendNode {node= node'} in
let session = State.get_session () in let session = State.get_session () in
let loc = State.get_loc_exn () in let loc = match State.get_loc () with Some l -> l | None -> Procdesc.Node.get_loc node' in
let ltr = State.get_loc_trace () in let ltr = State.get_loc_trace () in
log_issue_from_summary Exceptions.Error summary ~node ~session ~loc ~ltr exn log_issue_from_summary Exceptions.Error summary ~node ~session ~loc ~ltr exn

@ -86,6 +86,8 @@ let get_instr () = !gs.last_instr
let get_node_exn () = Option.value_exn !gs.last_node let get_node_exn () = Option.value_exn !gs.last_node
let get_node () = !gs.last_node
let get_loc_exn () = let get_loc_exn () =
match !gs.last_instr with match !gs.last_instr with
| Some instr -> | Some instr ->
@ -94,6 +96,10 @@ let get_loc_exn () =
get_node_exn () |> Procdesc.Node.get_loc get_node_exn () |> Procdesc.Node.get_loc
let get_loc () =
match !gs.last_instr with Some instr -> Some (Sil.instr_get_loc instr) | None -> None
(** normalize the list of instructions by renaming let-bound ids *) (** normalize the list of instructions by renaming let-bound ids *)
let instrs_normalize instrs = let instrs_normalize instrs =
let bound_ids = let bound_ids =

@ -31,12 +31,18 @@ val get_instr : unit -> Sil.instr option
val get_loc_exn : unit -> Location.t val get_loc_exn : unit -> Location.t
(** Get last location seen in symbolic execution *) (** Get last location seen in symbolic execution *)
val get_loc : unit -> Location.t option
(** Get last location seen in symbolic execution *)
val get_loc_trace : unit -> Errlog.loc_trace val get_loc_trace : unit -> Errlog.loc_trace
(** Get the location trace of the last path seen in symbolic execution *) (** Get the location trace of the last path seen in symbolic execution *)
val get_node_exn : unit -> Procdesc.Node.t val get_node_exn : unit -> Procdesc.Node.t
(** Get last node seen in symbolic execution *) (** Get last node seen in symbolic execution *)
val get_node : unit -> Procdesc.Node.t option
(** Get last node seen in symbolic execution *)
val get_normalized_pre : val get_normalized_pre :
(Tenv.t -> Prop.normal Prop.t -> Prop.normal Prop.t) -> Prop.normal Prop.t option (Tenv.t -> Prop.normal Prop.t -> Prop.normal Prop.t) -> Prop.normal Prop.t option
(** return the normalized precondition extracted form the last prop seen, if any (** return the normalized precondition extracted form the last prop seen, if any

Loading…
Cancel
Save