Skip to content

Commit 0774f82

Browse files
Merge pull request #1419 from matthiasblaesing/fix_crash_directcallback_mac_aarch64
Fix crash in direct callbacks on mac OS aarch64
2 parents 40a85ec + 988cd08 commit 0774f82

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

CHANGES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Bug Fixes
1616
---------
1717
* [#1411](https://github.com/java-native-access/jna/pull/1411): Do not throw `Win32Exception` on success for empty section in `Kernel32Util#getPrivateProfileSection` - [@mkarg](https://github.com/mkarg).
1818
* [#1414](https://github.com/java-native-access/jna/pull/1414): Fix definition of `c.s.j.p.unix.X11.XK_Shift_R` - [@matthiasblaesing](https://github.com/matthiasblaesing).
19+
* [#1323](https://github.com/java-native-access/jna/issues/1323). Fix crashes in direct callbacks on mac OS aarch64 - [@matthiasblaesing](https://github.com/matthiasblaesing).
1920

2021
Release 5.10.0
2122
==============

appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ install:
3131
# Must prepend cygwin PATH to avoid "cygheap base mismatch" from Git\usr\bin\sed
3232
- cmd: set PATH=C:\cygwin64;C:\cygwin64\bin;%JAVA_HOME%\bin;%PATH%;
3333
- cmd: choco install -y -f -i %CHOCO_PACKAGES%
34-
- cmd: '%CYGWIN_SETUP% --root C:\cygwin64 --local-package-dir C:\cygwin64\packages --quiet-mode --no-desktop --no-startmenu --packages %CYGWIN_PACKAGES%'
34+
- cmd: '%CYGWIN_SETUP% --root C:\cygwin64 --local-package-dir C:\cygwin64\packages --quiet-mode --no-desktop --no-startmenu --upgrade-also --packages %CYGWIN_PACKAGES%'
3535

3636
# Setup msvc environment
3737
for:

contrib/platform/test/com/sun/jna/platform/mac/IOKitTest.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
import static org.junit.Assert.assertNotNull;
3131
import static org.junit.Assert.assertNull;
3232
import static org.junit.Assert.assertTrue;
33+
import static org.junit.Assume.assumeTrue;
3334

3435
import java.util.HashSet;
3536
import java.util.Set;
@@ -166,8 +167,7 @@ public void testIteratorParentChild() {
166167

167168
// Get device name
168169
String controllerName = controllerDevice.getName();
169-
// Root controllers always begin with "AppleUSB"
170-
assertEquals("AppleUSB", controllerName.substring(0, 8));
170+
assertNotNull(controllerName);
171171

172172
// Get the first child, to test vs. iterator
173173
boolean testFirstChild = true;
@@ -177,7 +177,6 @@ public void testIteratorParentChild() {
177177
IOIterator childIter = controllerDevice.getChildIterator(IO_SERVICE);
178178
IORegistryEntry childDevice = childIter.next();
179179
while (childDevice != null) {
180-
assertTrue(childDevice.conformsTo("IOUSBDevice"));
181180
long childId = childDevice.getRegistryEntryID();
182181
assertTrue(childId > 19);
183182
assertFalse(uniqueEntryIdSet.contains(childId));

native/callback.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ create_callback(JNIEnv* env, jobject obj, jobject method,
288288
case 'D': cb->fptr_offset = OFFSETOF(env, CallDoubleMethod); break;
289289
default: cb->fptr_offset = OFFSETOF(env, CallObjectMethod); break;
290290
}
291-
status = ffi_prep_cif_var(&cb->java_cif, java_abi, 2, argc+3, java_return_type, cb->java_arg_types);
291+
status = ffi_prep_cif_var(&cb->java_cif, java_abi, 3, argc+3, java_return_type, cb->java_arg_types);
292292
if (!ffi_error(env, "callback setup (2)", status)) {
293293
ffi_prep_closure_loc(cb->closure, &cb->cif, dispatch_callback, cb,
294294
cb->x_closure);

0 commit comments

Comments
 (0)