@@ -630,6 +630,7 @@ let arm_vfp_params
630630
631631let get_arm_format_spec_parameters
632632 (cpars : fts_parameter_t list )
633+ (isinput : bool )
633634 (argspecs : argspec_int list ): fts_parameter_t list =
634635 let nextindex = (List. length cpars) + 1 in
635636 let update_core_reg aas (r : arm_reg_t ) =
@@ -707,30 +708,35 @@ let get_arm_format_spec_parameters
707708 aas_start_state cpars in
708709 let (_, pars, _, _) =
709710 List. fold_left (fun (aas , accpars , varargindex , nxtindex ) argspec ->
710- let ftype = get_fmt_spec_type argspec in
711- let ftype =
712- if is_float ftype then
713- promote_float ftype
714- else if is_int ftype then
715- promote_int ftype
716- else
717- ftype in
718- let size_r = size_of_btype ftype in
719711 let name = " vararg_" ^ (string_of_int varargindex) in
720712 let (param, new_state) =
721- match size_r with
722- | Ok 4 -> get_arm_int_param_next_state 4 name ftype aas nxtindex
723- | Ok 8 -> get_long_int_param_next_state 8 name ftype aas varargindex
724- | Ok size ->
725- raise
726- (BCH_failure
727- (LBLOCK [
728- STR " Var-arg size: " ; INT size; STR " not supported" ]))
729- | Error e ->
730- raise
731- (BCH_failure
732- (LBLOCK [
733- STR " Error in var-args: " ; STR (String. concat " ; " e)])) in
713+ if isinput then
714+ let vtype = get_fmt_spec_type argspec in
715+ let ftype = TPtr (vtype, [] ) in
716+ get_arm_int_param_next_state 4 name ftype aas nxtindex
717+ else
718+ let ftype = get_fmt_spec_type argspec in
719+ let ftype =
720+ if is_float ftype then
721+ promote_float ftype
722+ else if is_int ftype then
723+ promote_int ftype
724+ else
725+ ftype in
726+ let size_r = size_of_btype ftype in
727+ match size_r with
728+ | Ok 4 -> get_arm_int_param_next_state 4 name ftype aas nxtindex
729+ | Ok 8 -> get_long_int_param_next_state 8 name ftype aas varargindex
730+ | Ok size ->
731+ raise
732+ (BCH_failure
733+ (LBLOCK [
734+ STR " Var-arg size: " ; INT size; STR " not supported" ]))
735+ | Error e ->
736+ raise
737+ (BCH_failure
738+ (LBLOCK [
739+ STR " Error in var-args: " ; STR (String. concat " ; " e)])) in
734740 (new_state, param :: accpars, varargindex + 1 , nxtindex + 1 ))
735741 (fmtaas, [] , 1 , nextindex) argspecs in
736742 pars
0 commit comments