Skip to content

LOAD_FAST_BORROWED optimization can be missed after an empty block #138250

@DinoV

Description

@DinoV

Bug report

Bug description:

def x(tz_str):
    try:
        start, end = 1, 2
    except ValueError as e:
        raise Exception()

    return f(start, end)

This should produce a LOAD_FAST_BORROWED_LOAD_FAST_BORROWED opcode for loading start and end, but instead it produces LOAD_FAST_LOAD_FAST

CPython versions tested on:

3.14, CPython main branch

Operating systems tested on:

Linux

Linked PRs

Metadata

Metadata

Assignees

Labels

interpreter-core(Objects, Python, Grammar, and Parser dirs)performancePerformance or resource usagetype-bugAn unexpected behavior, bug, or error

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions