From 6e31e691c05e6af03be610055a0e72e48360ebaa Mon Sep 17 00:00:00 2001 From: Daiva Naudziuniene Date: Fri, 10 Nov 2017 10:04:32 -0800 Subject: [PATCH] [HIL] Do not drop right-hand HIL expression in the translation for SIL. Summary: In the translation from SIL to HIL we ignore the right-hand side expression if it consists of a single access path, e.g. unary operator. This diff preserves the right-hand side expression. Reviewed By: sblackshear Differential Revision: D6271814 fbshipit-source-id: c27e913 --- infer/src/IR/HilInstr.ml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/infer/src/IR/HilInstr.ml b/infer/src/IR/HilInstr.ml index 91e9e52ee..4e0c7ced1 100644 --- a/infer/src/IR/HilInstr.ml +++ b/infer/src/IR/HilInstr.ml @@ -47,8 +47,8 @@ let of_sil ~include_array_indexes ~f_resolve_id (instr: Sil.instr) = let exp_of_sil = HilExp.of_sil ~include_array_indexes ~f_resolve_id in let analyze_id_assignment lhs_id rhs_exp rhs_typ loc = let rhs_hil_exp = exp_of_sil rhs_exp rhs_typ in - match HilExp.get_access_paths rhs_hil_exp with - | [rhs_access_path] -> + match rhs_hil_exp with + | AccessPath rhs_access_path -> Bind (lhs_id, rhs_access_path) | _ -> Instr (Assign (((lhs_id, rhs_typ), []), rhs_hil_exp, loc))