1 Star 0 Fork 13

佛系少年中二/openjdk-21

forked from src-openEuler/openjdk-21 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
Backport-JDK-8333887-ubsan-unsafe.cpp:247:13:-runtim.patch 827 Bytes
一键复制 编辑 原始数据 按行查看 历史
wuyafang 提交于 2024-10-14 11:38 . sync bishengjdk21 patches
Subject: Backport of JDK-8333887 ubsan: unsafe.cpp:247:13: runtime error: store to null pointer of type 'volatile int'
---
src/hotspot/share/prims/unsafe.cpp | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/hotspot/share/prims/unsafe.cpp b/src/hotspot/share/prims/unsafe.cpp
index c6fd8449a..5c30182df 100644
--- a/src/hotspot/share/prims/unsafe.cpp
+++ b/src/hotspot/share/prims/unsafe.cpp
@@ -223,6 +223,11 @@ public:
return normalize_for_read(*addr());
}
+ // we use this method at some places for writing to 0 e.g. to cause a crash;
+ // ubsan does not know that this is the desired behavior
+#if defined(__clang__) || defined(__GNUC__)
+__attribute__((no_sanitize("undefined")))
+#endif
void put(T x) {
GuardUnsafeAccess guard(_thread);
*addr() = normalize_for_write(x);
--
2.33.0
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/Autistic_boyya/openjdk-21.git
[email protected]:Autistic_boyya/openjdk-21.git
Autistic_boyya
openjdk-21
openjdk-21
master

搜索帮助