8000 Generated interpreter does not spill the correct value of the stack pointer for output arrays. · Issue #131729 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

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

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

Closed
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
diegorusso pushed a commit to diegorusso/cpython that referenced this issue Apr 1, 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
diegorusso pushed a commit to diegorusso/cpython that referenced this issue Apr 1, 2025
seehwan pushed a commit to seehwan/cpython that referenced this issue Apr 16, 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
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
0