Skip to content

Commit 476058d

Browse files
committed
Use correct type of load for tp_version_tag.
1 parent 75d9a53 commit 476058d

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
@@ -2129,15 +2129,15 @@ dummy_func(
21292129
op(_GUARD_TYPE_VERSION, (type_version/2, owner -- owner)) {
21302130
PyTypeObject *tp = Py_TYPE(PyStackRef_AsPyObjectBorrow(owner));
21312131
assert(type_version != 0);
2132-
EXIT_IF(FT_ATOMIC_LOAD_UINT32_RELAXED(tp->tp_version_tag) != type_version);
2132+
EXIT_IF(FT_ATOMIC_LOAD_UINT_RELAXED(tp->tp_version_tag) != type_version);
21332133
}
21342134

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

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
@@ -1774,7 +1774,7 @@ function_get_version(PyObject *o, int opcode)
17741774
static uint32_t
17751775
type_get_version(PyTypeObject *t, int opcode)
17761776
{
1777-
uint32_t version = FT_ATOMIC_LOAD_UINT32_RELAXED(t->tp_version_tag);
1777+
uint32_t version = FT_ATOMIC_LOAD_UINT_RELAXED(t->tp_version_tag);
17781778
if (version == 0) {
17791779
SPECIALIZATION_FAIL(opcode, SPEC_FAIL_OUT_OF_VERSIONS);
17801780
return 0;

0 commit comments

Comments
 (0)