GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Redundant NULL check in profile_trampoline function (sysmodule.c) · Issue #96715 · python/cpython

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

New issue
Copy link
New issue
Copy link
Closed
#96716
Closed
Redundant NULL check in profile_trampoline function (sysmodule.c)#96715
#96716
Copy link
Assignees
pablogsal

Description

@chgnrdv
chgnrdv
opened on Sep 9, 2022
Issue body actions

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

cpython/Python/sysmodule.c

Line 959 in 88a7f66

PyObject *result = call_trampoline(tstate, self, frame, what, arg);

But similar check is already done by call_trampoline function

cpython/Python/sysmodule.c

Line 930 in 88a7f66

stack[2] = (arg != NULL) ? arg : Py_None;

My suggestion is to remove excess check from profile_trampoline.

Linked PRs

  • gh-96715 Remove redundant NULL check in profile_trampoline function #96716

Activity

  1. chgnrdv
    added
    type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
    on Sep 9, 2022
  2. iritkatriel
    removed
    type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
    on Sep 11, 2022
  3. gpshead
    assigned
    pablogsal
    on Sep 13, 2022
  4. kumaraditya303
    closed this as completedin #96716on Dec 12, 2022
  5. kumaraditya303
    added a commit that references this issue on Dec 12, 2022

    gh-96715 Remove redundant NULL check in `profile_trampoline` function (…

    3221b0d
  6. carljm
    added a commit that references this issue on Dec 14, 2022

    Merge branch 'main' into typedocs

    53d33a1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @pablogsal
    pablogsal

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402503 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.