You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[mypyc] Fix crash on accessing StopAsyncIteration (#21406)
Using `StopAsyncIteration` in `raise` expressions or as the caught type
in `except` blocks crashes at runtime because the generated code loads
the address of the `PyExc_StopAsyncIteration` variable and casts it to
`PyObject *`. The variable itself [is
already](https://github.com/python/cpython/blob/main/Include/pyerrors.h#L80)
a `PyObject *` so its address being interpreted as `PyObject *` is
incorrect.
To fix, add a special case to use `LoadGlobal` instead of `LoadAddress`
for builtin type variables that are already `PyObject *`.
0 commit comments