-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Interpreter doesn't wrap extern fun vars in Crystal procs #12495
Comments
For reference: This was discovered in #12456 (comment) |
This is a workaround for an interpreter bug (crystal-lang#12495) and basically restores the status before crystal-lang#12456.
Also a note that I briefly thought how to implement this but I have no idea. I get confused. And I won't have time to do this. So if someone wants to do it, please go ahead :-) I also noticed that things like |
This is also related to the We should decide whether that constructor accepts bytecode pointers or C function pointers. |
This code crashes the interpreter:
The problem is that
LibCPRE.free
's type isProc(Void*)
. Right now Crystal returns that type fromLibPCRE.free
, which is 16 bytes, but that's wrong. The actual size is 8 bytes and it needs to be wrapped in a FFI closure and then padded with zero to form the Proc.The text was updated successfully, but these errors were encountered: