Skip to content
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

Generated interpreter does not spill the correct value of the stack pointer for output arrays. #131729

Open
markshannon opened this issue Mar 25, 2025 · 0 comments
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error

Comments

@markshannon
Copy link
Member

markshannon commented Mar 25, 2025

Bug report

Bug description:

The generated C code for UNPACK_SEQUENCE_TUPLE saves the stack pointer before increasing it to account for the output array. This could result in some of the items being prematurely destroyed if seq is deleted.

https://github.com/python/cpython/blob/main/Python/generated_cases.c.h#L11927

CPython versions tested on:

CPython main branch

Operating systems tested on:

No response

Linked PRs

@markshannon markshannon added the type-bug An unexpected behavior, bug, or error label Mar 25, 2025
markshannon added a commit that referenced this issue Mar 26, 2025
* Rename 'defined' attribute to 'in_local' to more accurately reflect how it is used

* Make death of variables explicit even for array variables.

* Convert in_memory from boolean to stack offset

* Don't apply liveness analysis to optimizer generated code

* Fix RETURN_VALUE in optimizer
@picnixz picnixz added the interpreter-core (Objects, Python, Grammar, and Parser dirs) label Mar 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

2 participants