Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Possible (benign) overflow for 'K' format code indo_mkvalue #132909

Closed
Assignees
picnixz
Labels
interpreter-core(Objects, Python, Grammar, and Parser dirs)topic-C-APItype-bugAn unexpected behavior, bug, or error
@picnixz

Description

@picnixz

Bug report

Bug description:

This is probably not an issue but here are the known "temporary" overflows:

// format = 'K'returnPyLong_FromUnsignedLongLong((long long)va_arg(*p_va,unsignedlong long));

Note thatva_arg(*p_va, unsigned long long) will be converted into an unsigned long long, and then into a long long, and then back to an unsigned long long. So if we were to have an overflow here, it shouldn't really matter. Indeed, takev = (1ULL << 63) + 2. We have:

unsigned long longv2=va_arg(*p_va,unsignedlong long);// v2 = 9223372036854775810long longv3= (long long)v2;// v3 = -9223372036854775806PyObject*v4=PyLong_FromUnsignedLongLong(v3);// v4 = 9223372036854775810 as PyObject as v3 was casted back to an unsigned long long

CPython versions tested on:

CPython main branch

Operating systems tested on:

No response

Linked PRs

Metadata

Metadata

Assignees

Labels

interpreter-core(Objects, Python, Grammar, and Parser dirs)topic-C-APItype-bugAn unexpected behavior, bug, or error

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2025 Movatter.jp