diff --git a/infer/src/checkers/Pulse.ml b/infer/src/checkers/Pulse.ml index 149c6bdf4..0359d6492 100644 --- a/infer/src/checkers/Pulse.ml +++ b/infer/src/checkers/Pulse.ml @@ -93,10 +93,10 @@ module PulseTransferFunctions (CFG : ProcCfg.S) = struct when Typ.Procname.ObjC_Cpp.is_operator_equal callee_pname -> ( match actuals with (* We want to assign *lhs to *rhs when rhs is materialized temporary created in constructor *) - | [AccessExpression lhs; (HilExp.AccessExpression (AddressOf (Base rhs_base)) as rhs_exp)] + | [AccessExpression lhs; HilExp.AccessExpression (AddressOf (Base rhs_base as rhs_exp))] when Var.is_cpp_temporary (fst rhs_base) -> let lhs_deref = HilExp.AccessExpression.dereference lhs in - exec_assign summary lhs_deref rhs_exp call_loc astate + exec_assign summary lhs_deref (HilExp.AccessExpression rhs_exp) call_loc astate (* copy assignment *) | [AccessExpression lhs; HilExp.AccessExpression rhs] -> let lhs_deref = HilExp.AccessExpression.dereference lhs in diff --git a/infer/src/checkers/PulseModels.ml b/infer/src/checkers/PulseModels.ml index 23a2a9b6c..770d9208c 100644 --- a/infer/src/checkers/PulseModels.ml +++ b/infer/src/checkers/PulseModels.ml @@ -63,7 +63,7 @@ module Cplusplus = struct >>= fun astate -> ( match actuals with | AccessExpression lambda :: _ -> - PulseDomain.read location HilExp.AccessExpression.(dereference (dereference lambda)) astate + PulseDomain.read location HilExp.AccessExpression.(dereference lambda) astate >>= fun (astate, address) -> PulseDomain.Closures.check_captured_addresses location lambda address astate | _ ->