From 47954fc428b860de3113a01640f077b3f26bf0f3 Mon Sep 17 00:00:00 2001 From: Daiva Naudziuniene Date: Fri, 18 Dec 2020 04:04:30 -0800 Subject: [PATCH] [pulse] Do not drop astates in ExitScope instruction Reviewed By: skcho Differential Revision: D25637249 fbshipit-source-id: e50acf5c6 --- infer/src/pulse/Pulse.ml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/infer/src/pulse/Pulse.ml b/infer/src/pulse/Pulse.ml index af242c1f0..8055db11d 100644 --- a/infer/src/pulse/Pulse.ml +++ b/infer/src/pulse/Pulse.ml @@ -252,15 +252,15 @@ module PulseTransferFunctions = struct call_instr ; List.fold ~f:(fun astates (astate : Domain.t) -> - let astate = - match astate with - | ISLLatentMemoryError _ | AbortProgram _ | ExitProgram _ | LatentAbortProgram _ -> - [astate] - | ContinueProgram astate -> + match astate with + | ISLLatentMemoryError _ | AbortProgram _ | ExitProgram _ | LatentAbortProgram _ -> + astate :: astates + | ContinueProgram astate -> + let astate = dispatch_call analysis_data ret call_exp actuals location call_flags astate |> report_on_error_list analysis_data - in - List.rev_append astate astates ) + in + List.rev_append astate astates ) ~init:[] astate_list in let dynamic_types_unreachable = @@ -336,7 +336,7 @@ module PulseTransferFunctions = struct ~f:(fun astates (astate : Domain.t) -> match astate with | ISLLatentMemoryError _ | AbortProgram _ | ExitProgram _ | LatentAbortProgram _ -> - [astate] + astate :: astates | ContinueProgram astate -> let astate = PulseOperations.remove_vars vars location astate