1 Star 0 Fork 80

佛系少年中二/openjdk-1.8.0

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
GCC-12-reports-some-compiler-warnings.patch 1.93 KB
一键复制 编辑 原始数据 按行查看 历史
Benshuai5D 提交于 2024-03-30 16:52 . bug fix for 8u402
Subject: fix GCC 12 fails to compile AArch64 due to -Wstringop-overflow
---
hotspot/make/linux/makefiles/gcc.make | 2 +-
hotspot/src/share/vm/opto/type.cpp | 7 +++++--
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/hotspot/make/linux/makefiles/gcc.make b/hotspot/make/linux/makefiles/gcc.make
index 7dde7f096..d122f0eae 100644
--- a/hotspot/make/linux/makefiles/gcc.make
+++ b/hotspot/make/linux/makefiles/gcc.make
@@ -212,7 +212,7 @@ ifeq ($(USE_CLANG), true)
WARNINGS_ARE_ERRORS += -Wno-return-type -Wno-empty-body
endif
-WARNING_FLAGS = -Wpointer-arith -Wsign-compare -Wundef -Wunused-function -Wunused-value -Wformat=2 -Wreturn-type
+WARNING_FLAGS = -Wpointer-arith -Wsign-compare -Wundef -Wunused-function -Wunused-value -Wformat=2 -Wreturn-type -Wno-stringop-overflow
ifeq ($(USE_CLANG),)
# Since GCC 4.3, -Wconversion has changed its meanings to warn these implicit
diff --git a/hotspot/src/share/vm/opto/type.cpp b/hotspot/src/share/vm/opto/type.cpp
index 58572f137..92d4e6b70 100644
--- a/hotspot/src/share/vm/opto/type.cpp
+++ b/hotspot/src/share/vm/opto/type.cpp
@@ -2553,8 +2553,11 @@ TypeOopPtr::TypeOopPtr(TYPES t, PTR ptr, ciKlass* k, bool xk, ciObject* o, int o
_offset >= InstanceMirrorKlass::offset_of_static_fields()) {
// Static fields
assert(o != NULL, "must be constant");
- ciInstanceKlass* k = o->as_instance()->java_lang_Class_klass()->as_instance_klass();
- ciField* field = k->get_field_by_offset(_offset, true);
+ ciField* field = NULL;
+ if (o != NULL) {
+ ciInstanceKlass* k = o->as_instance()->java_lang_Class_klass()->as_instance_klass();
+ field = k->get_field_by_offset(_offset, true);
+ }
assert(field != NULL, "missing field");
BasicType basic_elem_type = field->layout_type();
_is_ptr_to_narrowoop = UseCompressedOops && (basic_elem_type == T_OBJECT ||
--
2.22.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/Autistic_boyya/openjdk-1.8.0.git
git@gitee.com:Autistic_boyya/openjdk-1.8.0.git
Autistic_boyya
openjdk-1.8.0
openjdk-1.8.0
master

搜索帮助

344bd9b3 5694891 D2dac590 5694891