-
Bug
-
Resolution: Fixed
-
P3
-
19, 20, repo-panama
-
None
The change in this commit:
https://github.com/openjdk/jdk/commit/9d43d25da8bcfff425a795dcc230914a384a5c82#diff-a311ae3c57c4204970424f03af3d0744a80f9ce43c2e4f6fdad8dc83bbfe515d
Introduced a regression in few routines such as MemorySegment.elements which want to ensure that the size of the segments has to be a multiple of the layout.
The check went from:
byteSize() % elementLayout.byteSize() != 0
To:
(byteSize() & (elementLayout.byteSize() - 1)) == 0;
The latter check only works for power of two (in fact we use it for alignment checks), so this change is incorrect.
https://github.com/openjdk/jdk/commit/9d43d25da8bcfff425a795dcc230914a384a5c82#diff-a311ae3c57c4204970424f03af3d0744a80f9ce43c2e4f6fdad8dc83bbfe515d
Introduced a regression in few routines such as MemorySegment.elements which want to ensure that the size of the segments has to be a multiple of the layout.
The check went from:
byteSize() % elementLayout.byteSize() != 0
To:
(byteSize() & (elementLayout.byteSize() - 1)) == 0;
The latter check only works for power of two (in fact we use it for alignment checks), so this change is incorrect.