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

Fix function pointers/delegates on Harvard architectures #4465

Merged
merged 4 commits into from
Aug 16, 2023

Conversation

kinke
Copy link
Member

@kinke kinke commented Aug 5, 2023

Resolves issue #4432 by setting the address space of such IR pointers.

{
foo(() {}, delegate() {});

FP fp = &bar;
Copy link
Member

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?

Copy link
Member Author

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.

@dukc
Copy link
Contributor

dukc commented Aug 8, 2023

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.

@kinke
Copy link
Member Author

kinke commented Aug 8, 2023

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').

@dukc
Copy link
Contributor

dukc commented Aug 8, 2023

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.

@kinke kinke merged commit e89e28e into ldc-developers:master Aug 16, 2023
22 checks passed
@kinke kinke deleted the fptr_as branch August 16, 2023 11:18
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.

3 participants