Skip to content

Type of vectorcall nargs inconsistent #134457

Closed
@rogerbinns

Description

@rogerbinns

Bug report

Bug description:

The documentation is clear that it is size_t

However if you search the Python source for nargs, it is often Py_ssize_t

One is signed and the other is unsigned. It looks like argument clinic is one culprit.

Ordinarily this is no big deal, because it would take too many arguments to overflow. However the clang undefined behaviour sanitizer gets upset when the sign on that parameter is wrong. See #111178 for why that matters.

I discovered this because I had copied argument clinic using Py_ssize_t and then hit ubsan issues.

CPython versions tested on:

3.14

Operating systems tested on:

Linux

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions