Skip to content

Commit

Permalink
Merge pull request #1358 from heuza/fix_ub
Browse files Browse the repository at this point in the history
Fix undefined behavior problem when using list_foreach_entry
  • Loading branch information
jpoimboe authored Sep 12, 2023
2 parents 089e74e + fb22714 commit 922cd45
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kpatch-build/list.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 922cd45

Please sign in to comment.