Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit6cd2f35

Browse files
[3.13]gh-129838: Don't redefine _Py_NO_SANITIZE_UNDEFINED (GH-129839) (#130366)
gh-129838: Don't redefine _Py_NO_SANITIZE_UNDEFINED (GH-129839)Newer GCC versions accept both __attribute__((no_sanitize("undefined")))and __attribute__((no_sanitize_undefined)) so check that the macro isnot already defined.(cherry picked from commit568db40)Co-authored-by: Collin Funk <collin.funk1@gmail.com>
1 parent38dfe01 commit6cd2f35

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Don't redefine ``_Py_NO_SANITIZE_UNDEFINED`` when compiling with a recent
2+
GCC version and undefined sanitizer enabled.

‎Modules/faulthandler.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,15 @@
3434
#definePUTS(fd,str) (void)_Py_write_noraise(fd, str, strlen(str))
3535

3636

37-
// clang uses __attribute__((no_sanitize("undefined")))
38-
// GCC 4.9+ uses __attribute__((no_sanitize_undefined))
39-
#if defined(__has_feature)// Clang
37+
// Clang and GCC 9.0+ use __attribute__((no_sanitize("undefined")))
38+
#if defined(__has_feature)
4039
# if__has_feature(undefined_behavior_sanitizer)
4140
# define_Py_NO_SANITIZE_UNDEFINED __attribute__((no_sanitize("undefined")))
4241
# endif
4342
#endif
44-
#if defined(__GNUC__) \
43+
44+
// GCC 4.9+ uses __attribute__((no_sanitize_undefined))
45+
#if !defined(_Py_NO_SANITIZE_UNDEFINED)&& defined(__GNUC__) \
4546
&& ((__GNUC__ >=5)|| (__GNUC__==4)&& (__GNUC_MINOR__ >=9))
4647
# define_Py_NO_SANITIZE_UNDEFINED __attribute__((no_sanitize_undefined))
4748
#endif

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp