Skip to content

Redundant NULL check in profile_trampoline function (sysmodule.c) #96715

@chgnrdv

Description

@chgnrdv

Code in profile_trampoline function checks if arg argument value is equal to NULL and in this case assigns Py_None to it

cpython/Python/sysmodule.c

Lines 954 to 956 in 88a7f66

if (arg == NULL) {
arg = Py_None;
}

The only place where arg is used in profile_trampoline is this call
PyObject *result = call_trampoline(tstate, self, frame, what, arg);

But similar check is already done by call_trampoline function
stack[2] = (arg != NULL) ? arg : Py_None;

My suggestion is to remove excess check from profile_trampoline.

Linked PRs

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    pFad - Phonifier reborn

    Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

    Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


    Alternative Proxies:

    Alternative Proxy

    pFad Proxy

    pFad v3 Proxy

    pFad v4 Proxy