Skip to content

[mypyc] Fix crash on accessing StopAsyncIteration#21406

Open
p-sawicki wants to merge 3 commits intopython:masterfrom
p-sawicki:fix-crash-stop-async-iteration
Open

[mypyc] Fix crash on accessing StopAsyncIteration#21406
p-sawicki wants to merge 3 commits intopython:masterfrom
p-sawicki:fix-crash-stop-async-iteration

Conversation

@p-sawicki
Copy link
Copy Markdown
Collaborator

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 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 *.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant