Skip to content

Commit

Permalink
Merge pull request #1419 from matthiasblaesing/fix_crash_directcallba…
Browse files Browse the repository at this point in the history
…ck_mac_aarch64

Fix crash in direct callbacks on mac OS aarch64
  • Loading branch information
matthiasblaesing authored Mar 14, 2022
2 parents 40a85ec + 988cd08 commit 0774f82
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Bug Fixes
---------
* [#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).
* [#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).
* [#1323](https://github.com/java-native-access/jna/issues/1323). Fix crashes in direct callbacks on mac OS aarch64 - [@matthiasblaesing](https://github.com/matthiasblaesing).

Release 5.10.0
==============
Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ install:
# Must prepend cygwin PATH to avoid "cygheap base mismatch" from Git\usr\bin\sed
- cmd: set PATH=C:\cygwin64;C:\cygwin64\bin;%JAVA_HOME%\bin;%PATH%;
- cmd: choco install -y -f -i %CHOCO_PACKAGES%
- cmd: '%CYGWIN_SETUP% --root C:\cygwin64 --local-package-dir C:\cygwin64\packages --quiet-mode --no-desktop --no-startmenu --packages %CYGWIN_PACKAGES%'
- cmd: '%CYGWIN_SETUP% --root C:\cygwin64 --local-package-dir C:\cygwin64\packages --quiet-mode --no-desktop --no-startmenu --upgrade-also --packages %CYGWIN_PACKAGES%'

# Setup msvc environment
for:
Expand Down
5 changes: 2 additions & 3 deletions contrib/platform/test/com/sun/jna/platform/mac/IOKitTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assume.assumeTrue;

import java.util.HashSet;
import java.util.Set;
Expand Down Expand Up @@ -166,8 +167,7 @@ public void testIteratorParentChild() {

// Get device name
String controllerName = controllerDevice.getName();
// Root controllers always begin with "AppleUSB"
assertEquals("AppleUSB", controllerName.substring(0, 8));
assertNotNull(controllerName);

// Get the first child, to test vs. iterator
boolean testFirstChild = true;
Expand All @@ -177,7 +177,6 @@ public void testIteratorParentChild() {
IOIterator childIter = controllerDevice.getChildIterator(IO_SERVICE);
IORegistryEntry childDevice = childIter.next();
while (childDevice != null) {
assertTrue(childDevice.conformsTo("IOUSBDevice"));
long childId = childDevice.getRegistryEntryID();
assertTrue(childId > 19);
assertFalse(uniqueEntryIdSet.contains(childId));
Expand Down
2 changes: 1 addition & 1 deletion native/callback.c
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ create_callback(JNIEnv* env, jobject obj, jobject method,
case 'D': cb->fptr_offset = OFFSETOF(env, CallDoubleMethod); break;
default: cb->fptr_offset = OFFSETOF(env, CallObjectMethod); break;
}
status = ffi_prep_cif_var(&cb->java_cif, java_abi, 2, argc+3, java_return_type, cb->java_arg_types);
status = ffi_prep_cif_var(&cb->java_cif, java_abi, 3, argc+3, java_return_type, cb->java_arg_types);
if (!ffi_error(env, "callback setup (2)", status)) {
ffi_prep_closure_loc(cb->closure, &cb->cif, dispatch_callback, cb,
cb->x_closure);
Expand Down

0 comments on commit 0774f82

Please sign in to comment.