aboutsummaryrefslogtreecommitdiffstats
path: root/cparser/StructPassing.ml
diff options
context:
space:
mode:
Diffstat (limited to 'cparser/StructPassing.ml')
-rw-r--r--cparser/StructPassing.ml11
1 files changed, 10 insertions, 1 deletions
diff --git a/cparser/StructPassing.ml b/cparser/StructPassing.ml
index 222da367..6d63b8f9 100644
--- a/cparser/StructPassing.ml
+++ b/cparser/StructPassing.ml
@@ -68,7 +68,16 @@ let classify_param env ty =
match !struct_passing_style with
| SP_ref_callee -> Param_unchanged
| SP_ref_caller -> Param_ref_caller
- | _ ->
+ | SP_value32_ref_callee ->
+ (match sizeof env ty, alignof env ty with
+ | Some sz, Some al ->
+ if (sz <= 4) then
+ Param_flattened ((sz+3)/4, sz, al) (* FIXME - why (sz+3)/4 ? *)
+ else
+ Param_unchanged
+ | _, _ -> Param_unchanged (* when parsing prototype with incomplete structure definition *)
+ )
+ | SP_split_args ->
match sizeof env ty, alignof env ty with
| Some sz, Some al ->
Param_flattened ((sz + 3) / 4, sz, al)