Skip to content

Commit e9ad27f

Browse files
committed
8339313: 32-bit build broken
Reviewed-by: coleenp, mbaesken, szaldana
1 parent ff85865 commit e9ad27f

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

test/hotspot/jtreg/runtime/exceptionMsgs/NoClassDefFoundError/libNoClassDefFoundErrorTest.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,22 @@ Java_NoClassDefFoundErrorTest_callFindClass(JNIEnv *env, jclass klass, jstring c
4747

4848

4949
static char* giant_string() {
50+
#ifdef _LP64
5051
size_t len = ((size_t)INT_MAX) + 3;
5152
char* c_name = malloc(len * sizeof(char));
5253
if (c_name != NULL) {
5354
memset(c_name, 'Y', len - 1);
5455
c_name[len - 1] = '\0';
5556
}
5657
return c_name;
58+
#else
59+
/* On 32-bit, gcc warns us against using values larger than ptrdiff_t for malloc,
60+
* memset and as array subscript. Since the chance of a 2GB allocation to be
61+
* successful is slim (would typically reach or exceed the user address space
62+
* size), lets just not bother. Returning NULL will cause the test to be silently
63+
* skipped. */
64+
return NULL;
65+
#endif
5766
}
5867

5968
JNIEXPORT jboolean JNICALL

test/hotspot/jtreg/serviceability/sa/libupcall.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,12 @@
2222
*/
2323

2424
#include <jni.h>
25+
#include <stdint.h>
2526

2627
typedef void (*upcall_func)(void);
2728

2829
JNIEXPORT void JNICALL
2930
Java_LingeredAppWithFFMUpcall_callJNI(JNIEnv *env, jclass cls, jlong upcallAddr) {
30-
upcall_func upcall = (upcall_func)upcallAddr;
31+
upcall_func upcall = (upcall_func)(uintptr_t)upcallAddr;
3132
upcall();
3233
}

0 commit comments

Comments
 (0)