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

[3.14] gh-146227: Fix wrong type in _Py_atomic_load_uint16 in pyatomic_std.h (gh-146229)#146232

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
colesbury merged 1 commit intopython:3.14fromcolesbury:backport-1eff27f-3.14
Mar 20, 2026
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletionsInclude/cpython/pyatomic.h
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -72,8 +72,8 @@
// def _Py_atomic_load_ptr_acquire(obj):
// return obj # acquire
//
// def _Py_atomic_store_ptr_release(obj):
//returnobj # release
// def _Py_atomic_store_ptr_release(obj, value):
// obj = value # release
//
// def _Py_atomic_fence_seq_cst():
// # sequential consistency
Expand DownExpand Up@@ -529,6 +529,9 @@ _Py_atomic_store_int_release(int *obj, int value);
static inline int
_Py_atomic_load_int_acquire(const int *obj);

static inline void
_Py_atomic_store_uint_release(unsigned int *obj, unsigned int value);

static inline void
_Py_atomic_store_uint32_release(uint32_t *obj, uint32_t value);

Expand Down
4 changes: 4 additions & 0 deletionsInclude/cpython/pyatomic_gcc.h
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -576,6 +576,10 @@ static inline void
_Py_atomic_store_ssize_release(Py_ssize_t *obj, Py_ssize_t value)
{ __atomic_store_n(obj, value, __ATOMIC_RELEASE); }

static inline void
_Py_atomic_store_uint_release(unsigned int *obj, unsigned int value)
{ __atomic_store_n(obj, value, __ATOMIC_RELEASE); }

static inline int
_Py_atomic_load_int_acquire(const int *obj)
{ return __atomic_load_n(obj, __ATOMIC_ACQUIRE); }
Expand Down
19 changes: 13 additions & 6 deletionsInclude/cpython/pyatomic_msc.h
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -971,12 +971,6 @@ _Py_atomic_store_ushort_relaxed(unsigned short *obj, unsigned short value)
*(volatile unsigned short *)obj = value;
}

static inline void
_Py_atomic_store_uint_release(unsigned int *obj, unsigned int value)
{
*(volatile unsigned int *)obj = value;
}

static inline void
_Py_atomic_store_long_relaxed(long *obj, long value)
{
Expand DownExpand Up@@ -1066,6 +1060,19 @@ _Py_atomic_store_int_release(int *obj, int value)
#endif
}

static inline void
_Py_atomic_store_uint_release(unsigned int *obj, unsigned int value)
{
#if defined(_M_X64) || defined(_M_IX86)
*(volatile unsigned int *)obj = value;
#elif defined(_M_ARM64)
_Py_atomic_ASSERT_ARG_TYPE(unsigned __int32);
__stlr32((unsigned __int32 volatile *)obj, (unsigned __int32)value);
#else
# error "no implementation of _Py_atomic_store_uint_release"
#endif
}

static inline void
_Py_atomic_store_ssize_release(Py_ssize_t *obj, Py_ssize_t value)
{
Expand Down
2 changes: 1 addition & 1 deletionInclude/cpython/pyatomic_std.h
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -459,7 +459,7 @@ static inline uint16_t
_Py_atomic_load_uint16(const uint16_t *obj)
{
_Py_USING_STD;
return atomic_load((const _Atomic(uint32_t)*)obj);
return atomic_load((const _Atomic(uint16_t)*)obj);
}

static inline uint32_t
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
Fix wrong type in ``_Py_atomic_load_uint16`` in the C11 atomics backend
(``pyatomic_std.h``), which used a 32-bit atomic load instead of 16-bit.
Found by Mohammed Zuhaib.
Loading

[8]ページ先頭

©2009-2026 Movatter.jp