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
intrinsics.objc_send
behaves differently than proc with @objc_type
and @objc_name
#2121
Comments
This appears to be an ABI related bug |
…ABI issues for `intrinsics.objc_send`)
Could you give this another go on the latest commit please, @jceipek? |
I had this issue too. Although I was on an m1 Mac and once I compiled to arm64 things were working. It may be important to test an arm64 build of the fix in case of regressions. Maybe add the example above to the test/issues folder |
@Lperlind One issue is that we cannot test arm64 with GitHub CI. So the tests would have to only be |
Okay, I guess I can manually verify the change in a bit on arm64. |
I did, and it works as expected! It also seems to eliminate the need for the hack here: Odin/vendor/darwin/Foundation/NSWindow.odin Lines 104 to 118 in 29f2ecd
Thanks! |
I can confirm arm64 is fine too. And running the x64 code with rosetta also passes. |
If this is fixed, I'll close the issue! |
I expect
MTK.View_setClearColor(mtkView, bgCol)
to be the same asmtkView->setClearColor(bgCol)
to be the same asintrinsics.objc_send(nil, mtkView, "setClearColor:", bgCol)
, but the runtime behavior seems to differ.Context
main.odin
program:Expected Behavior
The program should output:
Current Behavior
The program outputs:
Failure Information (for bugs)
Note that A and D print different output than B,C,E, and F. A and D do not seem to correlate with
bgCol
at all. B, C, E, and F have the red channel in the alpha channel and have 0 values in the other channels.This Objective-C program works as expected:
Steps to Reproduce
debug
containing a filemain.odin
with the contents of the test program above.$ odin build . -out:test
or$ odin build . -debug -out:test
$ ./test
. Note that the output for A and D varies between runs.The text was updated successfully, but these errors were encountered: