mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 06:45:07 +02:00
8303604: Passing by-value structs whose size is not power of 2 doesn't work on all platforms (mainline)
Reviewed-by: mcimadamore
This commit is contained in:
parent
dccfe8a2ee
commit
5977f266d0
11 changed files with 703 additions and 53 deletions
|
@ -25,6 +25,7 @@
|
|||
|
||||
package java.lang.invoke;
|
||||
|
||||
import jdk.internal.foreign.Utils;
|
||||
import sun.invoke.util.Wrapper;
|
||||
|
||||
import java.lang.reflect.Constructor;
|
||||
|
@ -314,7 +315,7 @@ final class VarHandles {
|
|||
if (!carrier.isPrimitive() || carrier == void.class || carrier == boolean.class) {
|
||||
throw new IllegalArgumentException("Invalid carrier: " + carrier.getName());
|
||||
}
|
||||
long size = Wrapper.forPrimitiveType(carrier).bitWidth() / 8;
|
||||
long size = Utils.byteWidthOfPrimitive(carrier);
|
||||
boolean be = byteOrder == ByteOrder.BIG_ENDIAN;
|
||||
boolean exact = false;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue