aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--cparser/StructPassing.ml16
1 files changed, 7 insertions, 9 deletions
diff --git a/cparser/StructPassing.ml b/cparser/StructPassing.ml
index 10aa6fd5..5c6454f0 100644
--- a/cparser/StructPassing.ml
+++ b/cparser/StructPassing.ml
@@ -317,23 +317,21 @@ let rec transf_expr env ctx e =
and transf_call env ctx opt_lhs fn args ty =
let ty' = transf_type env ty in
let fn' = transf_expr env Val fn in
- let (assignments, args') = transf_arguments env args in
let opt_eassign e =
match opt_lhs with
| None -> e
| Some lhs -> eassign lhs e in
match fn with
- | {edesc = EVar { C.name = "__builtin_annot"
+ | {edesc = EVar { C.name = "__builtin_va_arg"
+ | "__builtin_annot"
| "__builtin_annot_intval"
| "__builtin_ais_annot" } } ->
- (* Do not transform the call in this case, just use the default
- pass-by-reference mode for struct/union arguments. *)
- opt_eassign {edesc = ECall(fn, args); etyp = ty}
- | {edesc = EVar { C.name = "__builtin_va_arg" } } ->
- (* Do not transform the call in this case, just use the default
- pass-by-reference mode for struct/union arguments. *)
- opt_eassign {edesc = ECall(fn, args'); etyp = ty}
+ (* Do not transform the call in this case, just use the default
+ pass-by-reference mode for struct/union arguments. *)
+ let args' = List.map (fun arg -> transf_expr env Val arg) args in
+ opt_eassign {edesc = ECall(fn, args'); etyp = ty}
| _ ->
+ let (assignments, args') = transf_arguments env args in
let call =
match classify_return env ty with
| Ret_scalar ->