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

Using Py_XINCREF to replace Py_INCREF in PyAST_CompileObject #82798

Closed
shihai1991 opened this issue Oct 28, 2019 · 3 comments
Closed

Using Py_XINCREF to replace Py_INCREF in PyAST_CompileObject #82798

shihai1991 opened this issue Oct 28, 2019 · 3 comments
Labels
3.9 only security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) type-feature A feature request or enhancement

Comments

@shihai1991
Copy link
Member

BPO 38617
Nosy @serhiy-storchaka, @shihai1991
PRs
  • bpo-38617: Using Py_XINCREF to replace Py_INCREF in PyAST_CompileObject() #16963
  • 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 2019-10-28.15:59:23.594>
    created_at = <Date 2019-10-28.14:56:23.667>
    labels = ['interpreter-core', 'type-feature', 'invalid', '3.9']
    title = 'Using Py_XINCREF to replace Py_INCREF in PyAST_CompileObject'
    updated_at = <Date 2019-10-28.16:42:22.619>
    user = 'https://github.com/shihai1991'

    bugs.python.org fields:

    activity = <Date 2019-10-28.16:42:22.619>
    actor = 'shihai1991'
    assignee = 'none'
    closed = True
    closed_date = <Date 2019-10-28.15:59:23.594>
    closer = 'serhiy.storchaka'
    components = ['Interpreter Core']
    creation = <Date 2019-10-28.14:56:23.667>
    creator = 'shihai1991'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 38617
    keywords = ['patch']
    message_count = 3.0
    messages = ['355547', '355552', '355563']
    nosy_count = 2.0
    nosy_names = ['serhiy.storchaka', 'shihai1991']
    pr_nums = ['16963']
    priority = 'normal'
    resolution = 'not a bug'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue38617'
    versions = ['Python 3.9']

    @shihai1991
    Copy link
    Member Author

    1. param is unpredictable;
    2. the compiler_free() use Py_XDECREF(c->c_filename) in PyAST_CompileObject();

    @shihai1991 shihai1991 added 3.9 only security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) type-feature A feature request or enhancement labels Oct 28, 2019
    @serhiy-storchaka
    Copy link
    Member

    The filename argument must be non-NULL. The code that uses c_filename requires this.

    Py_XDECREF in compiler_free() could be replaced with Py_DECREF. But this is too tiny change which does not have significant effect.

    Actually both Py_INCREF and Py_XDECREF could be removed.

    @shihai1991
    Copy link
    Member Author

    Got it, thanks, Serhiy.

    @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.9 only security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants