1 Star 0 Fork 82

starlet_dx/openjdk-1.8.0

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
Fix-crash-in-JNI-s-GetDoubleArrayRegion-and-SetDoubl.patch 2.03 KB
一键复制 编辑 原始数据 按行查看 历史
From ff782010bb5610fb9bb9e9ebbf131ba71124d299 Mon Sep 17 00:00:00 2001
Subject: Fix crash in JNI's GetDoubleArrayRegion and SetDoubleArrayRegion
---
hotspot/src/share/vm/prims/jni.cpp | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/hotspot/src/share/vm/prims/jni.cpp b/hotspot/src/share/vm/prims/jni.cpp
index 953300ebc..c0d789b42 100644
--- a/hotspot/src/share/vm/prims/jni.cpp
+++ b/hotspot/src/share/vm/prims/jni.cpp
@@ -3805,7 +3805,7 @@ jni_Get##Result##ArrayRegion(JNIEnv *env, ElementType##Array array, jsize start,
int sc = TypeArrayKlass::cast(src->klass())->log2_element_size(); \
memcpy((u_char*) buf, \
(u_char*) src->Tag##_at_addr(start), \
- len << sc); \
+ (size_t)len << sc); \
} \
} \
JNI_END
@@ -3840,7 +3840,7 @@ jni_Get##Result##ArrayRegion(JNIEnv *env, ElementType##Array array, jsize start,
int sc = TypeArrayKlass::cast(src->klass())->log2_element_size(); \
memcpy((u_char*) buf, \
(u_char*) src->Tag##_at_addr(start), \
- len << sc); \
+ (size_t)len << sc); \
} \
} \
JNI_END
@@ -3888,8 +3888,8 @@ jni_Set##Result##ArrayRegion(JNIEnv *env, ElementType##Array array, jsize start,
if (len > 0) { \
int sc = TypeArrayKlass::cast(dst->klass())->log2_element_size(); \
memcpy((u_char*) dst->Tag##_at_addr(start), \
- (u_char*) buf, \
- len << sc); \
+ (u_char*) buf, \
+ (size_t)len << sc); \
} \
} \
JNI_END
@@ -3923,8 +3923,8 @@ jni_Set##Result##ArrayRegion(JNIEnv *env, ElementType##Array array, jsize start,
if (len > 0) { \
int sc = TypeArrayKlass::cast(dst->klass())->log2_element_size(); \
memcpy((u_char*) dst->Tag##_at_addr(start), \
- (u_char*) buf, \
- len << sc); \
+ (u_char*) buf, \
+ (size_t)len << sc); \
} \
} \
JNI_END
--
2.22.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/starlet-dx/openjdk-1.8.0.git
git@gitee.com:starlet-dx/openjdk-1.8.0.git
starlet-dx
openjdk-1.8.0
openjdk-1.8.0
master

搜索帮助