Skip to content

_PyEvalFramePushAndInit_Ex warning: 'stack_array' may be used uninitialized #142168

@utkonos

Description

@utkonos

Bug report

Bug description:

Probably a false positive, but this appears during build from source:

gcc  -fno-strict-overflow -Wsign-compare -DNDEBUG -g -O3 -Wall  -flto=auto  -fno-semantic-interposition -flto -fuse-linker-plugin -ffat-lto-objects -g -std=c11 -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wstrict-prototypes -Werror=implicit-function-declaration -fvisibility=hidden -fprofile-generate -I./Include/internal -I./Include/internal/mimalloc  -I. -I./Include    -fPIC -c ./Modules/mmapmodule.c -o Modules/mmapmodule.o
    default: Python/ceval.c: In function ‘_PyEvalFramePushAndInit_Ex’:
    default: Python/ceval.c:1900:38: warning: ‘stack_array’ may be used uninitialized [-Wmaybe-uninitialized]
    default:  1900 |     _PyInterpreterFrame *new_frame = _PyEvalFramePushAndInit(
    default:       |                                      ^~~~~~~~~~~~~~~~~~~~~~~~
    default:  1901 |         tstate, func, locals,
    default:       |         ~~~~~~~~~~~~~~~~~~~~~
    default:  1902 |         newargs, nargs, kwnames, previous
    default:       |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    default:  1903 |     );
    default:       |     ~
    default: Python/ceval.c:1823:1: note: by argument 4 of type ‘const union _PyStackRef *’ to ‘_PyEvalFramePushAndInit’ declared here
    default:  1823 | _PyEvalFramePushAndInit(PyThreadState *tstate, _PyStackRef func,
    default:       | ^~~~~~~~~~~~~~~~~~~~~~~
    default: Python/ceval.c:1869:17: note: ‘stack_array’ declared here
    default:  1869 |     _PyStackRef stack_array[8];
    default:       |                 ^~~~~~~~~~~

CPython versions tested on:

3.14

Operating systems tested on:

Linux

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    buildThe build process and cross-buildinterpreter-core(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions