changeset 57263:87fb3f5a499c

8220348: [ntintel] asserts about copying unaligned array Reviewed-by: clanger, stuefe
author mdoerr
date Fri, 06 Dec 2019 14:31:05 +0100
parents 2bea4bea7004
children ee448a1f33cc
files src/java.prefs/windows/native/libprefs/WindowsPreferences.c src/java.security.jgss/share/native/libj2gss/GSSLibStub.c
diffstat 2 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/java.prefs/windows/native/libprefs/WindowsPreferences.c	Fri Dec 06 14:13:10 2019 +0100
+++ b/src/java.prefs/windows/native/libprefs/WindowsPreferences.c	Fri Dec 06 14:31:05 2019 +0100
@@ -49,7 +49,7 @@
     int errorCode = RegOpenKeyEx((HKEY) hKey, str, 0, securityMask, &handle);
     (*env)->ReleaseByteArrayElements(env, lpSubKey, str, 0);
 
-    jlong tmp[2];
+    __declspec(align(8)) jlong tmp[2];
     tmp[0] = (jlong) handle;
     tmp[1] = errorCode;
     jlongArray result = (*env)->NewLongArray(env, 2);
@@ -78,7 +78,7 @@
         NULL, &handle, &lpdwDisposition);
     (*env)->ReleaseByteArrayElements(env, lpSubKey, str, 0);
 
-    jlong tmp[3];
+    __declspec(align(8)) jlong tmp[3];
     tmp[0] = (jlong) handle;
     tmp[1] = errorCode;
     tmp[2] = lpdwDisposition;
@@ -196,7 +196,7 @@
         &valuesNumber, &maxValueNameLength,
         NULL, NULL, NULL);
 
-    jlong tmp[5];
+    __declspec(align(8)) jlong tmp[5];
     tmp[0] = subKeysNumber;
     tmp[1] = errorCode;
     tmp[2] = valuesNumber;
--- a/src/java.security.jgss/share/native/libj2gss/GSSLibStub.c	Fri Dec 06 14:13:10 2019 +0100
+++ b/src/java.security.jgss/share/native/libj2gss/GSSLibStub.c	Fri Dec 06 14:31:05 2019 +0100
@@ -1164,6 +1164,9 @@
   OM_uint32 time;
   OM_uint32 flags;
   int isInitiator, isEstablished;
+#if defined (_WIN32) && defined (_MSC_VER)
+  __declspec(align(8))
+#endif
   jlong result[6];
   jlongArray jresult;