-
Bug
-
Resolution: Not an Issue
-
P3
-
None
-
repo-panama
The following test fails:
in libTestBool.c:
int get_bool() {
return 0x80000000;
}
In TestBool.java:
Addressable ma = findNativeOrThrow("get_bool");
FunctionDescriptor fd = FunctionDescriptor.of(C_BOOL);
MethodHandle GET_BOOL = LINKER.downcallHandle(ma, fd);
boolean result = (boolean) GET_BOOL.invokeExact();
assertTrue(result);
It seems that, even though the value of the int is non-zero, it is not converted to a boolean correctly (according to C rules).
in libTestBool.c:
int get_bool() {
return 0x80000000;
}
In TestBool.java:
Addressable ma = findNativeOrThrow("get_bool");
FunctionDescriptor fd = FunctionDescriptor.of(C_BOOL);
MethodHandle GET_BOOL = LINKER.downcallHandle(ma, fd);
boolean result = (boolean) GET_BOOL.invokeExact();
assertTrue(result);
It seems that, even though the value of the int is non-zero, it is not converted to a boolean correctly (according to C rules).