Skip to content
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

fixed #561: reverted binding of structs with flexible array members #565

Merged
merged 1 commit into from
May 11, 2021

Conversation

dkimitsa
Copy link
Contributor

@dkimitsa dkimitsa commented Mar 16, 2021

Issue #561 was introduced during ios13 binding generation.

Root case

To work with Flexible Array Members (FAM) its required to get pointer to the member and then navigate by it to put/get data.
When struct member is annotated as @ByVal it will return a COPY of first element of FAM instead of pointer to it.
Updating this element as array will not affect original struct (the issue itself) and is dangerous as will produce memory corruption if items changed at index 1+

…sible by applying @array({1}) annotations. This will return pointer to member. When it was annotated as `@ByVal` it was returning a copy of struct. And setting items to copy would cause memory corruption
@dkimitsa
Copy link
Contributor Author

few comments why struct binding are messing in post

@Tom-Ski Tom-Ski merged commit 1dc5ea2 into MobiVM:master May 11, 2021
@dkimitsa dkimitsa deleted the fix/561 branch October 20, 2021 10:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants