-
-
Notifications
You must be signed in to change notification settings - Fork 267
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
Fix function pointers/delegates on Harvard architectures #4465
Conversation
Resolves issue ldc-developers#4432 by setting the address space of such IR pointers.
{ | ||
foo(() {}, delegate() {}); | ||
|
||
FP fp = &bar; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably good to also add testing of (normal) pointers to variables.
No IR test to validate that the address-space is correct? Or do we assume that is already part of LLVM checking?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I was a bit lazy and wasn't sure how far we'd get with this. I've extended the test now, incl. storing and loading a function pointer in static data.
Great, thanks! I suggest a bit more stress-testing though: assigning a function pointer to a void pointer, pointer arithmetic and casting to/from an integral. |
Heh right, that's exactly what I don't expect to work yet ('not sure how far we'd get with this'). |
Understood 😄 . Function pointers/delegates aren't quite fixed though in that case. Granted, the original issue still is. One issue at a time is good way to work after all. |
Resolves issue #4432 by setting the address space of such IR pointers.