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

slice2java: fix max parameter count for constructors #1539

Closed
externl opened this issue Oct 6, 2023 · 0 comments · Fixed by #1540
Closed

slice2java: fix max parameter count for constructors #1539

externl opened this issue Oct 6, 2023 · 0 comments · Fixed by #1540
Assignees
Milestone

Comments

@externl
Copy link
Member

externl commented Oct 6, 2023

Java constructors must have a "length" that is less than 255. This length is not the number of parameters, but a special UNIT where all types are size 1 except long and double, which are 2.

The slice2java constructor does not count this number correctly and only looks at the number of parameters.

https://github.com/zeroc-ice/ice/blob/3.7/cpp/src/slice2java/Gen.cpp#L2554-L2557

This means that we can generate code that does not compile. For instance if you have a class with 127 doubles.

Proposed fix:
Fix the check to account for the correct size of long and double.

@externl externl added the java label Oct 6, 2023
@externl externl added this to the 3.7.10 milestone Oct 6, 2023
@externl externl added the bug label Oct 6, 2023
@externl externl self-assigned this Oct 9, 2023
externl added a commit to externl/ice that referenced this issue Oct 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant