Open
Description
In the case of a struct passing using SP_split_args
, this code of cparser/StructPassing.ml
is actually misleading
let classify_param env ty =
if is_composite_type env ty then begin
match !struct_passing_style with
| SP_ref_callee -> Param_unchanged
| SP_ref_caller -> Param_ref_caller
| _ ->
match sizeof env ty, alignof env ty with
| Some sz, Some al ->
Param_flattened ((sz + 3) / 4, sz, al)
| _, _ ->
Param_unchanged (* should not happen *)
end else
Param_unchanged
The should not happen
part actually happens for the test in test/regression/struct2.c :
struct B;
int f(struct B);
struct B { double d; };
int g() { struct B b; return f(b); }
This can be tested by replacing Param_unchanged (*should not happen *)
by a failwith "Should not happen"
, then attempting to compile test/regression/struct2.c
, on the x86_32-linux
architecture.
Metadata
Metadata
Assignees
Labels
No labels