Skip to content

Commit 66ec774

Browse files
Fix VS 2026
1 parent 19e02c2 commit 66ec774

File tree

3 files changed

+21
-10
lines changed

3 files changed

+21
-10
lines changed

Python/bytecodes.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2288,10 +2288,13 @@ dummy_func(
22882288
STAT_INC(LOAD_SUPER_ATTR, hit);
22892289
PyObject *name = GETITEM(FRAME_CO_NAMES, oparg >> 2);
22902290
PyTypeObject *cls = (PyTypeObject *)class;
2291-
// Note: not actually a pointer, just so that we can use restrict on it.
2292-
int *Py_MSVC_RESTRICT method_found = NULL;
2293-
PyObject *attr_o = _PySuper_Lookup(cls, self, name,
2294-
Py_TYPE(self)->tp_getattro == PyObject_GenericGetAttr ? (int *)&method_found : NULL);
2291+
int method_found = 0;
2292+
PyObject *attr_o;
2293+
Py_BEGIN_LOCALS_MUST_NOT_ESCAPE();.
2294+
int *Py_MSVC_RESTRICT method_found_ptr = &method_found;
2295+
attr_o = _PySuper_Lookup(cls, self, name,
2296+
Py_TYPE(self)->tp_getattro == PyObject_GenericGetAttr ? method_found_ptr : NULL);
2297+
Py_END_LOCALS_MUST_NOT_ESCAPE();
22952298
if (attr_o == NULL) {
22962299
ERROR_NO_POP();
22972300
}

Python/executor_cases.c.h

Lines changed: 7 additions & 3 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: 7 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)