Skip to content

Commit 226330e

Browse files
committed
Use correct type of load for tp_version_tag.
1 parent d6ea4f1 commit 226330e

File tree

4 files changed

+19
-19
lines changed

4 files changed

+19
-19
lines changed

Python/bytecodes.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2128,15 +2128,15 @@ dummy_func(
21282128
op(_GUARD_TYPE_VERSION, (type_version/2, owner -- owner)) {
21292129
PyTypeObject *tp = Py_TYPE(PyStackRef_AsPyObjectBorrow(owner));
21302130
assert(type_version != 0);
2131-
EXIT_IF(FT_ATOMIC_LOAD_UINT32_RELAXED(tp->tp_version_tag) != type_version);
2131+
EXIT_IF(FT_ATOMIC_LOAD_UINT_RELAXED(tp->tp_version_tag) != type_version);
21322132
}
21332133

21342134
op(_GUARD_TYPE_VERSION_AND_LOCK, (type_version/2, owner -- owner)) {
21352135
PyObject *owner_o = PyStackRef_AsPyObjectBorrow(owner);
21362136
assert(type_version != 0);
21372137
EXIT_IF(!LOCK_OBJECT(owner_o));
21382138
PyTypeObject *tp = Py_TYPE(owner_o);
2139-
if (FT_ATOMIC_LOAD_UINT32_RELAXED(tp->tp_version_tag) != type_version) {
2139+
if (FT_ATOMIC_LOAD_UINT_RELAXED(tp->tp_version_tag) != type_version) {
21402140
UNLOCK_OBJECT(owner_o);
21412141
EXIT_IF(true);
21422142
}

Python/executor_cases.c.h

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Python/generated_cases.c.h

Lines changed: 14 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Python/specialize.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1753,7 +1753,7 @@ function_get_version(PyObject *o, int opcode)
17531753
static uint32_t
17541754
type_get_version(PyTypeObject *t, int opcode)
17551755
{
1756-
uint32_t version = FT_ATOMIC_LOAD_UINT32_RELAXED(t->tp_version_tag);
1756+
uint32_t version = FT_ATOMIC_LOAD_UINT_RELAXED(t->tp_version_tag);
17571757
if (version == 0) {
17581758
SPECIALIZATION_FAIL(opcode, SPEC_FAIL_OUT_OF_VERSIONS);
17591759
return 0;

0 commit comments

Comments
 (0)