Repository navigation
GH-139922: Tail calling for MSVC (VS 2026) #143068
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
374874c
e0cd0f5
7e5555a
a75042a
fdfd8a0
058889e
c8d051b
ab70524
5c1c240
a04824f
da1adaf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
…tOptionalItem
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -205,14 +205,8 @@ PyObject_GetItem(PyObject *o, PyObject *key) | |
| return type_error("'%.200s' object is not subscriptable", o); | ||
| } | ||
|
|
||
| // MSVC fails during a tail call release build with loads of | ||
| // error C4737: Unable to perform required tail call. | ||
| // without using Py_NO_INLINE here, but PGO works fine. | ||
| #if defined(_MSC_VER) && !defined(__clang__) && _Py_TAIL_CALL_INTERP && !defined(_Py_USING_PGO) | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It needed lots of trial and error to come up with this unintuive minimal change needed to convince MSVC that the local variable passed by reference into Using it as an return value in |
||
| Py_NO_INLINE | ||
| #endif | ||
| int | ||
| PyMapping_GetOptionalItem(PyObject *obj, PyObject *key, PyObject **restrict result) | ||
| PyMapping_GetOptionalItem(PyObject *obj, PyObject *key, PyObject **result) | ||
| { | ||
| if (PyDict_CheckExact(obj)) { | ||
| return PyDict_GetItemRef(obj, key, result); | ||
|
|
@@ -230,6 +224,14 @@ PyMapping_GetOptionalItem(PyObject *obj, PyObject *key, PyObject **restrict resu | |
| return 0; | ||
| } | ||
|
|
||
| PyObject* | ||
| PyMapping_GetOptionalItem2(PyObject *obj, PyObject *key, int *err) | ||
| { | ||
| PyObject* result; | ||
| *err = PyMapping_GetOptionalItem(obj, key, &result); | ||
| return result; | ||
| } | ||
|
|
||
| int | ||
| PyObject_SetItem(PyObject *o, PyObject *key, PyObject *value) | ||
| { | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.