You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
Thankfully, at first glance there seems to be no hidden bug.
As I understand it, when parsing int f(struct B), this classify_param is called - since no information is available yet for struct B, the sizeof and alignof return None. classify_param is then returning Param_unchanged.
However, classify_param is called again when parsing f(b), where the structure has this time the relevant information available. So there seems to be no misbehaviour here.
You,re right that the comment was written with function definitions in mind (where incomplete structs cannot occur) and doesn't match what happens with function declarations (as in your example). At least a better comment is in order.
In the case of a struct passing using
SP_split_args
, this code ofcparser/StructPassing.ml
is actually misleadingThe
should not happen
part actually happens for the test in test/regression/struct2.c :This can be tested by replacing
Param_unchanged (*should not happen *)
by afailwith "Should not happen"
, then attempting to compiletest/regression/struct2.c
, on thex86_32-linux
architecture.The text was updated successfully, but these errors were encountered: