Skip to content

Type propagation does not account for the setting local variables via frame.f_locals in a debugger or similar. #115709

Closed
@markshannon

Description

@markshannon

Bug report

Bug description:

Consider

def testfunc(loops):
    for _ in range(loops):
        a = 1
        a + a
        a + a
        change_a()
        a + a

and suppose that change_a manages to change the value of the local a to "a".
Specialization will have converted the subsequent a + a to integer addition, and type propagation will have stripped the guard, resulting in a crash.

This is incredibly unlikely, and very hard to come up with a test for but it is theoretically possible.
It may be become more likely (and easier to test for) if PEP 667 is accepted.

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.13bugs and security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)release-blockertype-bugAn unexpected behavior, bug, or error

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions