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

Improve disassembly of the MAKE_FUNCTION instruction #77151

Closed
serhiy-storchaka opened this issue Feb 28, 2018 · 2 comments
Closed

Improve disassembly of the MAKE_FUNCTION instruction #77151

serhiy-storchaka opened this issue Feb 28, 2018 · 2 comments
Labels
3.8 only security fixes stdlib Python modules in the Lib dir type-feature A feature request or enhancement

Comments

@serhiy-storchaka
Copy link
Member

BPO 32970
Nosy @ncoghlan, @serhiy-storchaka, @1st1
PRs
  • bpo-32970: Improve disassembly of the MAKE_FUNCTION instruction. #5937
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2018-03-11.09:07:42.250>
    created_at = <Date 2018-02-28.16:31:31.732>
    labels = ['3.8', 'type-feature', 'library']
    title = 'Improve disassembly of the MAKE_FUNCTION instruction'
    updated_at = <Date 2018-03-11.09:07:42.249>
    user = 'https://github.com/serhiy-storchaka'

    bugs.python.org fields:

    activity = <Date 2018-03-11.09:07:42.249>
    actor = 'serhiy.storchaka'
    assignee = 'none'
    closed = True
    closed_date = <Date 2018-03-11.09:07:42.250>
    closer = 'serhiy.storchaka'
    components = ['Library (Lib)']
    creation = <Date 2018-02-28.16:31:31.732>
    creator = 'serhiy.storchaka'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 32970
    keywords = ['patch']
    message_count = 2.0
    messages = ['313060', '313590']
    nosy_count = 3.0
    nosy_names = ['ncoghlan', 'serhiy.storchaka', 'yselivanov']
    pr_nums = ['5937']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue32970'
    versions = ['Python 3.8']

    @serhiy-storchaka
    Copy link
    Member Author

    The proposed PR adds decryption of the MAKE_FUNCTION argument (it is a bits set) in the disassembler output. For example:

    $ echo 'def f(x, y=1, *, z=2): ...' | ./python -m dis
      1           0 LOAD_CONST               6 ((1,))
                  2 LOAD_CONST               1 (2)
                  4 LOAD_CONST               2 (('z',))
                  6 BUILD_CONST_KEY_MAP      1
                  8 LOAD_CONST               3 (<code object f at 0x7fe5ade8f300, file "<stdin>", line 1>)
                 10 LOAD_CONST               4 ('f')
                 12 MAKE_FUNCTION            3 (defaults, kwdefaults)
                 14 STORE_NAME               0 (f)
                 16 LOAD_CONST               5 (None)
                 18 RETURN_VALUE

    Disassembly of <code object f at 0x7fe5ade8f300, file "<stdin>", line 1>:
    1 0 LOAD_CONST 0 (None)
    2 RETURN_VALUE

    @serhiy-storchaka serhiy-storchaka added 3.8 only security fixes stdlib Python modules in the Lib dir type-feature A feature request or enhancement labels Feb 28, 2018
    @serhiy-storchaka
    Copy link
    Member Author

    New changeset e2732d3 by Serhiy Storchaka in branch 'master':
    bpo-32970: Improve disassembly of the MAKE_FUNCTION instruction. (GH-5937)
    e2732d3

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.8 only security fixes stdlib Python modules in the Lib dir type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant