Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix crash in direct callbacks on mac OS aarch64 #1419

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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