mirror of
https://github.com/openjdk/jdk.git
synced 2026-01-28 12:09:14 +00:00
8339313: 32-bit build broken
Reviewed-by: coleenp, mbaesken, szaldana
This commit is contained in:
parent
ff85865b75
commit
e9ad27fcdc
@ -47,6 +47,7 @@ Java_NoClassDefFoundErrorTest_callFindClass(JNIEnv *env, jclass klass, jstring c
|
||||
|
||||
|
||||
static char* giant_string() {
|
||||
#ifdef _LP64
|
||||
size_t len = ((size_t)INT_MAX) + 3;
|
||||
char* c_name = malloc(len * sizeof(char));
|
||||
if (c_name != NULL) {
|
||||
@ -54,6 +55,14 @@ static char* giant_string() {
|
||||
c_name[len - 1] = '\0';
|
||||
}
|
||||
return c_name;
|
||||
#else
|
||||
/* On 32-bit, gcc warns us against using values larger than ptrdiff_t for malloc,
|
||||
* memset and as array subscript. Since the chance of a 2GB allocation to be
|
||||
* successful is slim (would typically reach or exceed the user address space
|
||||
* size), lets just not bother. Returning NULL will cause the test to be silently
|
||||
* skipped. */
|
||||
return NULL;
|
||||
#endif
|
||||
}
|
||||
|
||||
JNIEXPORT jboolean JNICALL
|
||||
|
||||
@ -22,11 +22,12 @@
|
||||
*/
|
||||
|
||||
#include <jni.h>
|
||||
#include <stdint.h>
|
||||
|
||||
typedef void (*upcall_func)(void);
|
||||
|
||||
JNIEXPORT void JNICALL
|
||||
Java_LingeredAppWithFFMUpcall_callJNI(JNIEnv *env, jclass cls, jlong upcallAddr) {
|
||||
upcall_func upcall = (upcall_func)upcallAddr;
|
||||
upcall_func upcall = (upcall_func)(uintptr_t)upcallAddr;
|
||||
upcall();
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user