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
std.DynLib corrupts struct passed by value #19841
Comments
Passing the struct as pointer works, and replacing the struct with a u8 also works. So it has something to do with copy by value. |
im getting some (unrelated) weird build errors from this but i believe the problem is this line |
@xdBronch yep! that is issue. but can DynLib assert something for function pointers missing callconv? maybe assert callconv is not the default |
that might work, i wouldve asserted that its specifically the C callconv idk what happens with any of the others |
…h an unspecified callconv fixes ziglang#19841
Zig Version
0.13.0-dev.46+3648d7df1
Steps to Reproduce and Observed Behavior
Env:
Windows 11
Version 10.0.22631 Build 22631
Repo: https://github.com/Pyrolistical/dynlib-struct-pass-by-value-repo
Run
zig build run
Outputs:
Expected Behavior
Expected DynLib to be the same as extern:
The text was updated successfully, but these errors were encountered: