diff --git a/infer/src/nullsafe/eradicate.ml b/infer/src/nullsafe/eradicate.ml index a8736843e..2f0c3884f 100644 --- a/infer/src/nullsafe/eradicate.ml +++ b/infer/src/nullsafe/eradicate.ml @@ -94,16 +94,11 @@ module MkCallback (Extension : ExtensionT) : CallBackT = struct let do_node tenv node typestate = NodePrinter.with_session ~pp_name node ~f:(fun () -> State.set_node node ; + if Config.write_html then L.d_printfln "before:@\n%a@\n" TypeState.pp typestate ; let typestates_succ, typestates_exn = TypeCheck.typecheck_node tenv calls_this checks idenv curr_pname curr_pdesc find_canonical_duplicate annotated_signature typestate node linereader in - if Config.write_html then ( - let d_typestate ts = L.d_printfln "%a" TypeState.pp ts in - L.d_strln "before:" ; - d_typestate typestate ; - L.d_strln "after:" ; - List.iter ~f:d_typestate typestates_succ ) ; (typestates_succ, typestates_exn) ) diff --git a/infer/src/nullsafe/typeCheck.ml b/infer/src/nullsafe/typeCheck.ml index a8cad4878..1d6c852f9 100644 --- a/infer/src/nullsafe/typeCheck.ml +++ b/infer/src/nullsafe/typeCheck.ml @@ -7,6 +7,7 @@ open! IStd module F = Format +module L = Logging module DExp = DecompiledExp (** Module for type checking. *) @@ -1199,11 +1200,15 @@ let typecheck_node tenv calls_this checks idenv curr_pname curr_pdesc find_canon (* keep unique instruction reference per-node *) TypeErr.InstrRef.gen instr_ref_gen in - let instr' = + let post = typecheck_instr tenv calls_this checks node idenv curr_pname curr_pdesc find_canonical_duplicate annotated_signature instr_ref linereader typestate instr in - handle_exceptions typestate instr ; instr' + if Config.write_html then ( + L.d_printfln "instr: %a@\n" (Sil.pp_instr ~print_types:true Pp.text) instr ; + L.d_printfln "new state:@\n%a@\n" TypeState.pp post ) ; + handle_exceptions typestate instr ; + post in (* Reset 'always' field for forall errors to false. *) (* This is used to track if it is set to true for all visit to the node. *)