-
Notifications
You must be signed in to change notification settings - Fork 162
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lpython emits invalid c code when passing an object to a function #2179
Comments
The last time we fixed it for a subroutine (struct passed to subroutine). This time it seems we have a struct passed to a function. I fixed it here #2180. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
lpython version: 18.2
This a variation of a bug I opened in the past (#2059). The bug was fixed but it has morphed into something else.
Consider the code, pass_address_bug.py:
compiling with lpython,
$ lpython pass_address_bug.py --show-c > bug.c
produces the following code, bug.c:
The problem is in the line:
_lpython_return_variable = print_val_0_in_struct_0(struct_1_instance->val_1);
It should be
_lpython_return_variable = print_val_0_in_struct_0(&struct_1_instance->val_1);
Note that the following code, pass_address_works.py, is compiled correctly:
The text was updated successfully, but these errors were encountered: