代码拉取完成,页面将自动刷新
From 2173df77292171f45a6c314af4c7bb73587cad4c Mon Sep 17 00:00:00 2001
From: Weinan Liu <wnliu@google.com>
Date: Wed, 9 Aug 2023 22:31:21 +0000
Subject: [PATCH 38/38] Fix undefined behavior problem when using
list_foreach_entry
This upstream list.h offsetof implementation rely on undefined behavior implementation. Using __builtin_offsetof to fix this problem.
---
kpatch-build/list.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kpatch-build/list.h b/kpatch-build/list.h
index e95593c..ad4643c 100644
--- a/kpatch-build/list.h
+++ b/kpatch-build/list.h
@@ -30,7 +30,7 @@
/**
* Get offset of a member
*/
-#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
+#define offsetof(TYPE, MEMBER) ((size_t) __builtin_offsetof(TYPE, MEMBER))
/**
* Casts a member of a structure out to the containing structure
--
2.33.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。