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

LARGE_INTEGER needs to populate both union fields #1196

Merged
merged 2 commits into from
May 17, 2020

Conversation

dbwiddis
Copy link
Contributor

As discussed on the mailing list. Initial commit is a failing test case.

@dbwiddis dbwiddis marked this pull request as ready for review May 17, 2020 15:33
@dbwiddis
Copy link
Contributor Author

Fixed by overriding read() in the union to explicitly read both fields. Test now passes.

@matthiasblaesing
Copy link
Member

Looks good to me. Thank you.

@matthiasblaesing matthiasblaesing merged commit 2afa6da into java-native-access:master May 17, 2020
@dbwiddis dbwiddis deleted the largeintfix branch May 17, 2020 19:31
@dbwiddis
Copy link
Contributor Author

My CI just pointed out an inconsistency with other methods. Should the overridden read call super.read()? Looking at the code I don't think it's necessary in this specific case but might be a good idea.

@matthiasblaesing
Copy link
Member

I don't see a problem. Structure#read basicly cycles through all structure fields and calls readField on them. Union overrides this and blocks reads from fields, that don't belong to the current selected type.

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.

2 participants