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

all: struct return fixes #221

Merged
merged 1 commit into from
Apr 4, 2024

Conversation

TotallyGamerJet
Copy link
Collaborator

@TotallyGamerJet TotallyGamerJet commented Apr 3, 2024

On amd64, there was a crash when calling objc.Send with a struct return type. This was due to calling the wrong objc message send function.

On arm64, if a struct return contained structs that only contained floats it would expect it to be in R8 instead of the expected float registers

Closes #223

On amd64, objective-c crashed when calling objc.Send with a struct return type. This was due to calling the wrong objc message send function.

On arm64, if a struct return contained structs that only contained floats it would expect it to be in R8 instead of the expected float registers

There are tests for all of the above.
Copy link
Member

@hajimehoshi hajimehoshi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

Let's add "Closes #223" to a commit message.

@TotallyGamerJet TotallyGamerJet merged commit d0aedd0 into ebitengine:main Apr 4, 2024
20 checks passed
@TotallyGamerJet TotallyGamerJet deleted the fix_structs branch April 4, 2024 02:46
@TotallyGamerJet
Copy link
Collaborator Author

TotallyGamerJet commented Apr 4, 2024

@hajimehoshi if this does fix the issue in ebitengine should this be cherry-picked for 0.7?

@hajimehoshi
Copy link
Member

Confirmed this worked perfectly with Ebitengine. I'll update go.mod.

hajimehoshi pushed a commit that referenced this pull request Apr 4, 2024
On amd64, there was a crash when calling objc.Send with a struct return type. This was due to calling the wrong objc message send function.

On arm64, if a struct return contained structs that only contained floats it would expect it to be in R8 instead of the expected float registers

Closes #223
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.

objc: returning a struct only with floats from Send crashes on amd64 and doesn't work on arm64
2 participants