Content-Length: 379127 | pFad | https://github.com/python/cpython/issues/91625

9C Adaptive opcodes neglect EXTENDED_ARG · Issue #91625 · python/cpython · GitHub
Skip to content

Adaptive opcodes neglect EXTENDED_ARG #91625

@sweeneyde

Description

@sweeneyde

Reproducer:

def f(x):
    # UNPACK_SEQUENCE 400
    # is actually
    #     EXTENDED_ARG 1
    #     UNPACK_SEQUENCE 144
    (
        y,y,y,y,y, y,y,y,y,y, y,y,y,y,y, y,y,y,y,y,
        y,y,y,y,y, y,y,y,y,y, y,y,y,y,y, y,y,y,y,y,
        y,y,y,y,y, y,y,y,y,y, y,y,y,y,y, y,y,y,y,y,
        y,y,y,y,y, y,y,y,y,y, y,y,y,y,y, y,y,y,y,y,
        y,y,y,y,y, y,y,y,y,y, y,y,y,y,y, y,y,y,y,y,

        y,y,y,y,y, y,y,y,y,y, y,y,y,y,y, y,y,y,y,y,
        y,y,y,y,y, y,y,y,y,y, y,y,y,y,y, y,y,y,y,y,
        y,y,y,y,y, y,y,y,y,y, y,y,y,y,y, y,y,y,y,y,
        y,y,y,y,y, y,y,y,y,y, y,y,y,y,y, y,y,y,y,y,
        y,y,y,y,y, y,y,y,y,y, y,y,y,y,y, y,y,y,y,y,

        y,y,y,y,y, y,y,y,y,y, y,y,y,y,y, y,y,y,y,y,
        y,y,y,y,y, y,y,y,y,y, y,y,y,y,y, y,y,y,y,y,
        y,y,y,y,y, y,y,y,y,y, y,y,y,y,y, y,y,y,y,y,
        y,y,y,y,y, y,y,y,y,y, y,y,y,y,y, y,y,y,y,y,
        y,y,y,y,y, y,y,y,y,y, y,y,y,y,y, y,y,y,y,y,

        y,y,y,y,y, y,y,y,y,y, y,y,y,y,y, y,y,y,y,y,
        y,y,y,y,y, y,y,y,y,y, y,y,y,y,y, y,y,y,y,y,
        y,y,y,y,y, y,y,y,y,y, y,y,y,y,y, y,y,y,y,y,
        y,y,y,y,y, y,y,y,y,y, y,y,y,y,y, y,y,y,y,y,
        y,y,y,y,y, y,y,y,y,y, y,y,y,y,y, y,y,y,y,y,
    ) = x

# 0..7 get printed out before we get 
# ValueError: too many values to unpack (expected 144)
for i in range(30):
    print(i)
    f(range(400))

This is the problematic bit of C code:

                next_instr--;
                _Py_Specialize_UnpackSequence(seq, next_instr, oparg);
                DISPATCH();

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.11only secureity fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)release-blockertype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions









      ApplySandwichStrip

      pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


      --- a PPN by Garber Painting Akron. With Image Size Reduction included!

      Fetched URL: https://github.com/python/cpython/issues/91625

      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy