@@ -711,22 +711,45 @@ let translate_arm_instruction
711711 else
712712 register_of_arm_register AR0 in
713713 let returnvar = floc#f#env#mk_register_variable returnreg in
714- let (usecmds, use) =
715- List. fold_left (fun (acccmds , accuse ) (p , _x ) ->
714+ let (usecmds, use, usehigh) =
715+ List. fold_left (fun (acccmds , accuse , accusehigh ) (p , x ) ->
716+ let ptype = get_parameter_type p in
717+ let addressedvars =
718+ if is_pointer ptype then
719+ let xx = rewrite_expr floc x in
720+ match BCHARMDisassemblyUtils. get_string_reference floc xx with
721+ | Some _ -> []
722+ | _ ->
723+ match xx with
724+ | XVar _ -> []
725+ | _ ->
726+ TR. tfold
727+ ~ok: (fun v -> [v])
728+ ~error: (fun e ->
729+ let _ = log_dc_error_result __FILE__ __LINE__ e in
730+ [] )
731+ (floc#get_var_at_address ~btype: (ptr_deref ptype) xx)
732+ else
733+ [] in
716734 if is_register_parameter p then
717735 let regarg = TR. tget_ok (get_register_parameter_register p) in
718736 let pvar = floc#f#env#mk_register_variable regarg in
719- (acccmds, pvar :: accuse)
737+ (acccmds,
738+ pvar :: (addressedvars @ accuse),
739+ addressedvars @ accusehigh)
740+
720741 else if is_stack_parameter p then
721742 let p_offset = TR. tget_ok (get_stack_parameter_offset p) in
722743 let stackop = arm_sp_deref ~with_offset: p_offset RD in
723744 TR. tfold
724745 ~ok: (fun (stacklhs , stacklhscmds ) ->
725- (stacklhscmds @ acccmds, stacklhs :: accuse))
746+ (stacklhscmds @ acccmds,
747+ stacklhs :: (addressedvars @ accuse),
748+ addressedvars @ accusehigh))
726749 ~error: (fun e ->
727750 begin
728751 log_error_result __FILE__ __LINE__ e;
729- (acccmds, accuse)
752+ (acccmds, accuse, accusehigh )
730753 end )
731754 (stackop#to_lhs floc)
732755 else
@@ -735,8 +758,8 @@ let translate_arm_instruction
735758 (LBLOCK [
736759 floc#l#toPretty;
737760 STR " Parameter type not recognized in call translation" ])))
738- ([] , [] ) callargs in
739- let usehigh = get_use_high_vars (List. map snd callargs) in
761+ ([] , [] , [] ) callargs in
762+ let usehigh = usehigh @ ( get_use_high_vars (List. map snd callargs) ) in
740763 let vr1 = floc#f#env#mk_arm_register_variable AR1 in
741764 let vr2 = floc#f#env#mk_arm_register_variable AR2 in
742765 let vr3 = floc#f#env#mk_arm_register_variable AR3 in
0 commit comments