1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
| | For some reason, the original code gets miscompiled on x86_64, leading
'Java_java_io_VMFile_isFile' to return true when the return value of
'cpio_checkType' is ENOENT (= 2).
See <https://issues.guix.gnu.org/issue/36685>
and <https://issues.guix.gnu.org/49990>.
diff --git a/native/jni/java-io/java_io_VMFile.c b/native/jni/java-io/java_io_VMFile.c
index de1320b..9a5d375 100644
--- a/native/jni/java-io/java_io_VMFile.c
+++ b/native/jni/java-io/java_io_VMFile.c
@@ -278,6 +278,7 @@ Java_java_io_VMFile_isFile (JNIEnv * env,
const char *filename;
int result;
jint entryType;
+ jboolean isfile;
/* Don't use the JCL convert function because it throws an exception
on failure */
@@ -288,9 +289,10 @@ Java_java_io_VMFile_isFile (JNIEnv * env,
}
result = cpio_checkType (filename, &entryType);
+ isfile = (result == CPNATIVE_OK && entryType == CPFILE_FILE ? 1 : 0);
(*env)->ReleaseStringUTFChars (env, name, filename);
- return result == CPNATIVE_OK && entryType == CPFILE_FILE ? 1 : 0;
+ return isfile;
#else /* not WITHOUT_FILESYSTEM */
return 0;
#endif /* not WITHOUT_FILESYSTEM */
|